virtio_blk: Fix an SG_IO regression
authorBart Van Assche <bart.vanassche@wdc.com>
Fri, 27 Oct 2017 14:23:21 +0000 (08:23 -0600)
committerJens Axboe <axboe@kernel.dk>
Fri, 27 Oct 2017 14:23:21 +0000 (08:23 -0600)
commitefea2abcb03215f2efadfe994ff7f652aaff196b
tree5c16510723274dfea91e4f0e9d4100a62e41b360
parent93689a603141ca9237203cebfa6b45775caccdb5
virtio_blk: Fix an SG_IO regression

Avoid that submitting an SG_IO ioctl triggers a kernel oops that
is preceded by:

usercopy: kernel memory overwrite attempt detected to (null) (<null>) (6 bytes)
kernel BUG at mm/usercopy.c:72!

Reported-by: Dann Frazier <dann.frazier@canonical.com>
Fixes: commit ca18d6f769d2 ("block: Make most scsi_req_init() calls implicit")
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Dann Frazier <dann.frazier@canonical.com>
Cc: <stable@vger.kernel.org> # v4.13
Reviewed-by: Christoph Hellwig <hch@lst.de>
Moved virtblk_initialize_rq() inside CONFIG_VIRTIO_BLK_SCSI.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/virtio_blk.c