qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] virtio-blk: refuse SG_IO requests with scsi=off


From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH] virtio-blk: refuse SG_IO requests with scsi=off
Date: Fri, 13 Jan 2012 10:54:57 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.23) Gecko/20110922 Lightning/1.0b2 Thunderbird/3.1.15

On 12/23/2011 08:39 AM, Paolo Bonzini wrote:
QEMU does have a "scsi" option (to be used like -device
virtio-blk-pci,drive=foo,scsi=off).  However, it only
masks the feature bit, and does not reject the command
if a malicious guest disregards the feature bits and
issues a request.

Without this patch, using scsi=off does not protect you
from CVE-2011-4127.

Signed-off-by: Paolo Bonzini<address@hidden>

Applied.  Thanks.

Regards,

Anthony Liguori

---
  hw/virtio-blk.c |    6 ++++++
  1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c
index b70d116..6cd3164 100644
--- a/hw/virtio-blk.c
+++ b/hw/virtio-blk.c
@@ -153,6 +153,12 @@ static void virtio_blk_handle_scsi(VirtIOBlockReq *req)
      int status;
      int i;

+    if ((req->dev->vdev.guest_features&  (1<<  VIRTIO_BLK_F_SCSI)) == 0) {
+        virtio_blk_req_complete(req, VIRTIO_BLK_S_UNSUPP);
+        g_free(req);
+        return;
+    }
+
      /*
       * We require at least one output segment each for the virtio_blk_outhdr
       * and the SCSI command block.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]