From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:45399) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T3ruR-00073z-B9 for qemu-devel@nongnu.org; Tue, 21 Aug 2012 13:06:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T3ruQ-0002iU-3C for qemu-devel@nongnu.org; Tue, 21 Aug 2012 13:06:31 -0400 Received: from mail-gh0-f173.google.com ([209.85.160.173]:61109) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T3ruP-0002gN-UE for qemu-devel@nongnu.org; Tue, 21 Aug 2012 13:06:29 -0400 Received: by mail-gh0-f173.google.com with SMTP id r17so31193ghr.4 for ; Tue, 21 Aug 2012 10:06:29 -0700 (PDT) Sender: fluxion From: Michael Roth Date: Tue, 21 Aug 2012 12:05:41 -0500 Message-Id: <1345568757-14365-8-git-send-email-mdroth@linux.vnet.ibm.com> In-Reply-To: <1345568757-14365-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1345568757-14365-1-git-send-email-mdroth@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 07/23] virtio-blk: fix use-after-free while handling scsi commands List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aliguori@us.ibm.com From: Avi Kivity 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 Signed-off-by: Avi Kivity Signed-off-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf (cherry picked from commit 730a9c53b4e52681fcfe31cf38854cbf91e132c7) Signed-off-by: Michael Roth --- hw/virtio-blk.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c index fe07746..f44d244 100644 --- a/hw/virtio-blk.c +++ b/hw/virtio-blk.c @@ -253,6 +253,7 @@ static void virtio_blk_handle_scsi(VirtIOBlockReq *req) virtio_blk_req_complete(req, status); g_free(req); + return; #else abort(); #endif -- 1.7.9.5