From: Christoph Hellwig <hch@lst.de> Date: 2017-01-04 05:25:17
Without this fix attempts to do scsi passthrough on virtio_blk will crash
the system on virtually mapped stacks, which is something happening during
boot with many distros.
From: Christoph Hellwig <hch@lst.de> Date: 2017-01-04 05:25:25
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>
---
drivers/block/virtio_blk.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
From: Jason Wang <hidden> Date: 2017-01-04 07:45:35
On 2017年01月04日 13:25, Christoph Hellwig wrote:
quoted hunk
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>
---
drivers/block/virtio_blk.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
Hi Christoph,
2017-01-04 6:25 GMT+01:00 Christoph Hellwig [off-list ref]:
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.
This sounds scary.
Could you share how to reproduce it, this should go into stable if
it's the case.
Thanks,
Jinpu
From: Christoph Hellwig <hch@lst.de> Date: 2017-01-09 13:35:58
Is someone going to pick the patch up and send it to Linus? I keep
running into all kinds of boot failures whenever I forget to cherry
pick it into my development trees..
Is someone going to pick the patch up and send it to Linus? I keep
running into all kinds of boot failures whenever I forget to cherry
pick it into my development trees..
From: "Michael S. Tsirkin" <mst@redhat.com> Date: 2017-01-09 16:33:18
On Wed, Jan 04, 2017 at 08:25:05AM +0300, Christoph Hellwig wrote:
quoted hunk
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>
---
drivers/block/virtio_blk.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)