[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL v2 09/30] hw/pci-bridge: Fix invalid free()
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL v2 09/30] hw/pci-bridge: Fix invalid free() |
Date: |
Tue, 18 Dec 2018 11:11:46 -0500 |
From: Matthias Weckbecker <address@hidden>
When loadvm'ing a *running* snapshot qemu crashes due to an invalid
free. It's fortunately caught early by glibc heap memory corruption
protection and qemu gets killed with SIGABRT.
Steps to reproduce:
1) Create VM (e.g w/ virsh define)
2) Start the VM and take a snapshot while it's running and having a
PCI bridge attached
3) Destroy the VM and revert the running snapshot.
This commit fixes the issue.
Signed-off-by: Matthias Weckbecker <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
hw/pci/pci_bridge.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/pci/pci_bridge.c b/hw/pci/pci_bridge.c
index ee9dff2d3a..b9143ac88b 100644
--- a/hw/pci/pci_bridge.c
+++ b/hw/pci/pci_bridge.c
@@ -241,9 +241,9 @@ void pci_bridge_update_mappings(PCIBridge *br)
* while another accesses an unaffected region. */
memory_region_transaction_begin();
pci_bridge_region_del(br, br->windows);
+ pci_bridge_region_cleanup(br, w);
br->windows = pci_bridge_region_init(br);
memory_region_transaction_commit();
- pci_bridge_region_cleanup(br, w);
}
/* default write_config function for PCI-to-PCI bridge */
--
MST
- [Qemu-devel] [PULL v2 00/30] pci, pc, virtio: fixes, features, Michael S. Tsirkin, 2018/12/18
- [Qemu-devel] [PULL v2 01/30] pcie: set link state inactive/active after hot unplug/plug, Michael S. Tsirkin, 2018/12/18
- [Qemu-devel] [PULL v2 03/30] virtio: Helper for registering virtio device types, Michael S. Tsirkin, 2018/12/18
- [Qemu-devel] [PULL v2 02/30] pc:piix4: Update smbus I/O space after a migration, Michael S. Tsirkin, 2018/12/18
- [Qemu-devel] [PULL v2 04/30] virtio: Provide version-specific variants of virtio PCI devices, Michael S. Tsirkin, 2018/12/18
- [Qemu-devel] [PULL v2 05/30] tests: Remove unused include, Michael S. Tsirkin, 2018/12/18
- [Qemu-devel] [PULL v2 06/30] hw/smbios: Restrict access to "hw/smbios/ipmi.h", Michael S. Tsirkin, 2018/12/18
- [Qemu-devel] [PULL v2 08/30] hw/smbios: Move to the hw/firmware/ subdirectory, Michael S. Tsirkin, 2018/12/18
- [Qemu-devel] [PULL v2 09/30] hw/pci-bridge: Fix invalid free(),
Michael S. Tsirkin <=
- [Qemu-devel] [PULL v2 07/30] hw/smbios: Remove "smbios_ipmi.h", Michael S. Tsirkin, 2018/12/18
- [Qemu-devel] [PULL v2 10/30] pcie: Create enums for link speed and width, Michael S. Tsirkin, 2018/12/18
- [Qemu-devel] [PULL v2 11/30] pci: Sync PCIe downstream port LNKSTA on read, Michael S. Tsirkin, 2018/12/18
- [Qemu-devel] [PULL v2 12/30] qapi: Define PCIe link speed and width properties, Michael S. Tsirkin, 2018/12/18
- [Qemu-devel] [PULL v2 13/30] pcie: Add link speed and width fields to PCIESlot, Michael S. Tsirkin, 2018/12/18
- [Qemu-devel] [PULL v2 15/30] pcie: Allow generic PCIe root port to specify link speed and width, Michael S. Tsirkin, 2018/12/18
- [Qemu-devel] [PULL v2 14/30] pcie: Fill PCIESlot link fields to support higher speeds and widths, Michael S. Tsirkin, 2018/12/18
- [Qemu-devel] [PULL v2 16/30] vfio/pci: Remove PCIe Link Status emulation, Michael S. Tsirkin, 2018/12/18
- [Qemu-devel] [PULL v2 17/30] pcie: Fast PCIe root ports for new machines, Michael S. Tsirkin, 2018/12/18
- [Qemu-devel] [PULL v2 18/30] intel_iommu: dump correct iova when failed, Michael S. Tsirkin, 2018/12/18