[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 14/14] qiov: prevent double free or use-after-free
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 14/14] qiov: prevent double free or use-after-free |
Date: |
Thu, 15 Dec 2011 15:09:29 +0100 |
From: Paolo Bonzini <address@hidden>
qemu_iovec_destroy does not clear the QEMUIOVector fully, and the data
could thus be used after free or freed again. While I do not know any
example in the tree, I observed this using virtio-scsi (and SCSI
scatter/gather) when canceling DMA requests.
Signed-off-by: Paolo Bonzini <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
cutils.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/cutils.c b/cutils.c
index 6db6304..24b3fe3 100644
--- a/cutils.c
+++ b/cutils.c
@@ -217,7 +217,10 @@ void qemu_iovec_destroy(QEMUIOVector *qiov)
{
assert(qiov->nalloc != -1);
+ qemu_iovec_reset(qiov);
g_free(qiov->iov);
+ qiov->nalloc = 0;
+ qiov->iov = NULL;
}
void qemu_iovec_reset(QEMUIOVector *qiov)
--
1.7.6.4
- [Qemu-devel] [PATCH 02/14] block: simplify failure handling for bdrv_aio_multiwrite, (continued)
- [Qemu-devel] [PATCH 02/14] block: simplify failure handling for bdrv_aio_multiwrite, Kevin Wolf, 2011/12/15
- [Qemu-devel] [PATCH 06/14] block: avoid useless checks on acb->bh, Kevin Wolf, 2011/12/15
- [Qemu-devel] [PATCH 03/14] block: qemu_aio_get does not return NULL, Kevin Wolf, 2011/12/15
- [Qemu-devel] [PATCH 07/14] block/qcow2.c: call qcow2_free_snapshots in the function of qcow2_close, Kevin Wolf, 2011/12/15
- [Qemu-devel] [PATCH 04/14] dma: the passed io_func does not return NULL, Kevin Wolf, 2011/12/15
- [Qemu-devel] [PATCH 08/14] rbd: always set out parameter in qemu_rbd_snap_list, Kevin Wolf, 2011/12/15
- [Qemu-devel] [PATCH 05/14] block: dma_bdrv_* does not return NULL, Kevin Wolf, 2011/12/15
- [Qemu-devel] [PATCH 11/14] qcow2: Allow >4 GB VM state, Kevin Wolf, 2011/12/15
- [Qemu-devel] [PATCH 09/14] qemu-img rebase: Fix for undersized backing files, Kevin Wolf, 2011/12/15
- [Qemu-devel] [PATCH 13/14] block/cow: Return real error code, Kevin Wolf, 2011/12/15
- [Qemu-devel] [PATCH 14/14] qiov: prevent double free or use-after-free,
Kevin Wolf <=
- [Qemu-devel] [PATCH 10/14] Documentation: Add qemu-img -t parameter in man page, Kevin Wolf, 2011/12/15
- [Qemu-devel] [PATCH 12/14] coroutine: switch per-thread free pool to a global pool, Kevin Wolf, 2011/12/15
- Re: [Qemu-devel] [PULL 00/14] Block patches, Anthony Liguori, 2011/12/19