]> git.proxmox.com Git - qemu.git/commitdiff
virtio-blk: fix use-after-free while handling scsi commands
authorAvi Kivity <avi@redhat.com>
Mon, 6 Aug 2012 12:49:03 +0000 (15:49 +0300)
committerKevin Wolf <kwolf@redhat.com>
Fri, 10 Aug 2012 08:25:11 +0000 (10:25 +0200)
The scsi passthrough handler falls through after completing a
request into the failure path, resulting in a use after free.

Reproducible by running a guest with aio=native on a block device.

Reported-by: Stefan Priebe <s.priebe@profihost.ag>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
hw/virtio-blk.c

index f21757ed55bf68d5f2ead6e939aa8766f00fe273..552b3b6c6ad4233d30496aff751af285ea18cec6 100644 (file)
@@ -254,6 +254,7 @@ static void virtio_blk_handle_scsi(VirtIOBlockReq *req)
 
     virtio_blk_req_complete(req, status);
     g_free(req);
+    return;
 #else
     abort();
 #endif