From: Avi Kivity <avi@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH master/stable] virtio-mlk: fix use-after-free while handling scsi commands
Date: Mon, 6 Aug 2012 15:49:03 +0300 [thread overview]
Message-ID: <1344257343-11298-1-git-send-email-avi@redhat.com> (raw)
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
next reply other threads:[~2012-08-06 12:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-06 12:49 Avi Kivity [this message]
2012-08-06 13:11 ` [Qemu-devel] [PATCH master/stable] virtio-mlk: fix use-after-free while handling scsi commands Stefan Hajnoczi
2012-08-06 13:14 ` Avi Kivity
2012-08-06 14:21 ` Andreas Färber
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1344257343-11298-1-git-send-email-avi@redhat.com \
--to=avi@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).