stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Patch "virtio_blk: Fix an SG_IO regression" has been added to the 4.13-stable tree
@ 2017-11-05 14:44 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2017-11-05 14:44 UTC (permalink / raw)
  To: bart.vanassche, axboe, dann.frazier, gregkh, hch, mst
  Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    virtio_blk: Fix an SG_IO regression

to the 4.13-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     virtio_blk-fix-an-sg_io-regression.patch
and it can be found in the queue-4.13 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From efea2abcb03215f2efadfe994ff7f652aaff196b Mon Sep 17 00:00:00 2001
From: Bart Van Assche <bart.vanassche@wdc.com>
Date: Fri, 27 Oct 2017 08:23:21 -0600
Subject: virtio_blk: Fix an SG_IO regression

From: Bart Van Assche <bart.vanassche@wdc.com>

commit efea2abcb03215f2efadfe994ff7f652aaff196b upstream.

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>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Moved virtblk_initialize_rq() inside CONFIG_VIRTIO_BLK_SCSI.

Signed-off-by: Jens Axboe <axboe@kernel.dk>

---
 drivers/block/virtio_blk.c |   12 ++++++++++++
 1 file changed, 12 insertions(+)

--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -593,10 +593,22 @@ static int virtblk_map_queues(struct blk
 	return blk_mq_virtio_map_queues(set, vblk->vdev, 0);
 }
 
+#ifdef CONFIG_VIRTIO_BLK_SCSI
+static void virtblk_initialize_rq(struct request *req)
+{
+	struct virtblk_req *vbr = blk_mq_rq_to_pdu(req);
+
+	scsi_req_init(&vbr->sreq);
+}
+#endif
+
 static const struct blk_mq_ops virtio_mq_ops = {
 	.queue_rq	= virtio_queue_rq,
 	.complete	= virtblk_request_done,
 	.init_request	= virtblk_init_request,
+#ifdef CONFIG_VIRTIO_BLK_SCSI
+	.initialize_rq_fn = virtblk_initialize_rq,
+#endif
 	.map_queues	= virtblk_map_queues,
 };
 


Patches currently in stable-queue which might be from bart.vanassche@wdc.com are

queue-4.13/virtio_blk-fix-an-sg_io-regression.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-11-05 14:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-05 14:44 Patch "virtio_blk: Fix an SG_IO regression" has been added to the 4.13-stable tree gregkh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).