qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH master/stable] virtio-mlk: fix use-after-free while handling scsi commands
@ 2012-08-06 12:49 Avi Kivity
  2012-08-06 13:11 ` Stefan Hajnoczi
  0 siblings, 1 reply; 4+ messages in thread
From: Avi Kivity @ 2012-08-06 12:49 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: qemu-devel

The scsi passthrough handler falls through after completing a
request into the failure path, resulting in a use after free.

Reprducible 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>
---
 hw/virtio-blk.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c
index f21757e..552b3b6 100644
--- a/hw/virtio-blk.c
+++ b/hw/virtio-blk.c
@@ -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
-- 
1.7.11.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-08-06 14:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-06 12:49 [Qemu-devel] [PATCH master/stable] virtio-mlk: fix use-after-free while handling scsi commands Avi Kivity
2012-08-06 13:11 ` Stefan Hajnoczi
2012-08-06 13:14   ` Avi Kivity
2012-08-06 14:21   ` Andreas Färber

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).