Skip to contentSkip to conversation

virtio-mlk: fix use-after-free while handling scsi commands

PATCH In review Avi Kivity 3 participants 4 messages Aug 6, 2012

lore
Share & tools
lore

Avi Kivity

author
#0 lore raw

PATCH 1/1 virtio-mlk: fix use-after-free while handling scsi commands

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.

---
 hw/virtio-blk.c | 1 +
 1 file changed, 1 insertion(+)
hw/virtio-blk.c +1 -0
index f21757e..552b3b6 100644
@@ -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
Signature · 1 line
1.7.11.3
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Avi Kivity

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.

---
 hw/virtio-blk.c | 1 +
 1 file changed, 1 insertion(+)

It would be nice to fix up the commit message:
s/virtio-mlk/virtio-blk/

author
#2 lore raw
Quoted 6 lines · Stefan Hajnoczi
Quoted 5 lines · Avi Kivity

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.

Quoted 8 lines
Quoted 5 lines
---
 hw/virtio-blk.c | 1 +
 1 file changed, 1 insertion(+)

It would be nice to fix up the commit message:
s/virtio-mlk/virtio-blk/

Sorry, an off-by-two. Presumably Kevin will fix it up.

Quoted 3 lines

Thanks.

Signature · 1 line
error compiling committee.c: too many arguments to function
#3 lore raw
In reply to Stefan Hajnoczi

Am 06.08.2012 15:11, schrieb Stefan Hajnoczi:

Quoted 5 lines · Avi Kivity
Quoted 4 lines

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.

While at it, also "Reproducible".

/-F

Quoted 11 lines
Quoted 6 lines
---
 hw/virtio-blk.c | 1 +
 1 file changed, 1 insertion(+)

It would be nice to fix up the commit message:
s/virtio-mlk/virtio-blk/

Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg