[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-stable] [PATCH 37/43] vfio-pci: Fix missing unparent of dynamicall
From: |
Michael Roth |
Subject: |
[Qemu-stable] [PATCH 37/43] vfio-pci: Fix missing unparent of dynamically allocated MemoryRegion |
Date: |
Tue, 24 Feb 2015 15:48:12 -0600 |
From: Alex Williamson <address@hidden>
Commit d8d95814609e added explicit object_unparent() calls for
dynamically allocated MemoryRegions. The VFIOMSIXInfo structure also
contains such a MemoryRegion, covering the mmap'd region of a PCI BAR
above the MSI-X table. This structure is freed as part of the class
exit function and therefore also needs an explicit object_unparent().
Failing to do this results in random segfaults due to fields within
the structure, often the class pointer, being reclaimed and corrupted
by the time object_finalize_child_property() is called for the object.
Signed-off-by: Alex Williamson <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Cc: address@hidden # 2.2
(cherry picked from commit 3a4dbe6aa934370a92372528c1255ee1504965ee)
Signed-off-by: Michael Roth <address@hidden>
---
hw/misc/vfio.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/misc/vfio.c b/hw/misc/vfio.c
index fd318a1..7bff62c 100644
--- a/hw/misc/vfio.c
+++ b/hw/misc/vfio.c
@@ -4049,6 +4049,7 @@ static void vfio_put_device(VFIODevice *vdev)
DPRINTF("vfio_put_device: close vdev->fd\n");
close(vdev->fd);
if (vdev->msix) {
+ object_unparent(OBJECT(&vdev->msix->mmap_mem));
g_free(vdev->msix);
vdev->msix = NULL;
}
--
1.9.1
- [Qemu-stable] [PATCH 28/43] pckbd: set bits 2-3-6-7 of the output port by default, (continued)
- [Qemu-stable] [PATCH 28/43] pckbd: set bits 2-3-6-7 of the output port by default, Michael Roth, 2015/02/24
- [Qemu-stable] [PATCH 30/43] scsi: fix cancellation when I/O was completed but DMA was not., Michael Roth, 2015/02/24
- [Qemu-stable] [PATCH 32/43] vt82c686: avoid out-of-bounds read, Michael Roth, 2015/02/24
- [Qemu-stable] [PATCH 31/43] target-i386: fix movntsd on big-endian hosts, Michael Roth, 2015/02/24
- [Qemu-stable] [PATCH 33/43] virtio: fix feature bit checks, Michael Roth, 2015/02/24
- [Qemu-stable] [PATCH 02/43] block: Omit bdrv_find_format for essential drivers, Michael Roth, 2015/02/24
- [Qemu-stable] [PATCH 36/43] target-arm/translate-a64: Fix wrong mmu_idx usage for LDT/STT, Michael Roth, 2015/02/24
- [Qemu-stable] [PATCH 34/43] sb16: fix interrupt acknowledgement, Michael Roth, 2015/02/24
- [Qemu-stable] [PATCH 35/43] hw/input/hid.c Fix capslock hid code, Michael Roth, 2015/02/24
- [Qemu-stable] [PATCH 39/43] libcacard: stop linking against every single 3rd party library, Michael Roth, 2015/02/24
- [Qemu-stable] [PATCH 37/43] vfio-pci: Fix missing unparent of dynamically allocated MemoryRegion,
Michael Roth <=
- [Qemu-stable] [PATCH 38/43] qemu-thread: fix qemu_event without futexes, Michael Roth, 2015/02/24
- [Qemu-stable] [PATCH 40/43] fix mc146818rtc wrong subsection name to avoid vmstate_subsection_load() fail, Michael Roth, 2015/02/24
- [Qemu-stable] [PATCH 03/43] block/vvfat: qcow driver may not be found, Michael Roth, 2015/02/24
- [Qemu-stable] [PATCH 43/43] exec: change default exception_index value for migration to -1, Michael Roth, 2015/02/24
- [Qemu-stable] [PATCH 41/43] block/iscsi: fix uninitialized variable, Michael Roth, 2015/02/24
- [Qemu-stable] [PATCH 42/43] qtest: Fix deadloop by running main loop AIO context's timers, Michael Roth, 2015/02/24
- [Qemu-stable] [PATCH 04/43] block/nfs: Add create_opts, Michael Roth, 2015/02/24
- [Qemu-stable] [PATCH 06/43] qemu-img: Check create_opts before image creation, Michael Roth, 2015/02/24
- [Qemu-stable] [PATCH 08/43] iotests: Only kill NBD server if it runs, Michael Roth, 2015/02/24
- [Qemu-stable] [PATCH 05/43] block: Check create_opts before image creation, Michael Roth, 2015/02/24