]> git.baikalelectronics.ru Git - kernel.git/commit
virtio_blk: avoid DMA to stack for the sense buffer
authorChristoph Hellwig <hch@lst.de>
Mon, 9 Jan 2017 15:56:23 +0000 (08:56 -0700)
committerJens Axboe <axboe@fb.com>
Tue, 10 Jan 2017 20:30:50 +0000 (13:30 -0700)
commit4f8f7904b0cdc7a14287fe550e0a8562d546711d
treeb441577383d9ca1586799d28a031d99e9d6e967d
parent0ff183e1137eef70b8241e8bb1736b020fe52388
virtio_blk: avoid DMA to stack for the sense buffer

Most users of BLOCK_PC requests allocate the sense buffer on the stack,
so to avoid DMA to the stack copy them to a field in the heap allocated
virtblk_req structure.  Without that any attempt at SCSI passthrough I/O,
including the SG_IO ioctl from userspace will crash the kernel.  Note that
this includes running tools like hdparm even when the host does not have
SCSI passthrough enabled.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Cc: stable@vger.kernel.org # v4.9+
Signed-off-by: Jens Axboe <axboe@fb.com>
drivers/block/virtio_blk.c