From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:42985) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SyMkE-0000H6-Jh for qemu-devel@nongnu.org; Mon, 06 Aug 2012 08:49:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SyMk8-0002Pj-OM for qemu-devel@nongnu.org; Mon, 06 Aug 2012 08:49:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59933) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SyMk8-0002PY-BK for qemu-devel@nongnu.org; Mon, 06 Aug 2012 08:49:08 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q76Cn7UV030409 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 6 Aug 2012 08:49:07 -0400 From: Avi Kivity Date: Mon, 6 Aug 2012 15:49:03 +0300 Message-Id: <1344257343-11298-1-git-send-email-avi@redhat.com> Subject: [Qemu-devel] [PATCH master/stable] virtio-mlk: fix use-after-free while handling scsi commands List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-devel@nongnu.org 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 Signed-off-by: Avi Kivity --- 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