]> Git Repo - qemu.git/commitdiff
Ignore pci unplug requests for unpluggable devices (CVE-2011-1751)
authorGerd Hoffmann <[email protected]>
Wed, 27 Apr 2011 09:05:34 +0000 (11:05 +0200)
committerGerd Hoffmann <[email protected]>
Thu, 19 May 2011 09:06:49 +0000 (11:06 +0200)
This patch makes qemu ignore unplug requests from the guest for pci
devices which are tagged as non-hotpluggable.  Trouble spot is the
piix4 chipset with the ISA bridge.  Requests to unplug that one will
make it go away together with all ISA bus devices, which are not
prepared to be unplugged and thus don't cleanup, leaving active
qemu timers behind in free'ed memory.

Signed-off-by: Gerd Hoffmann <[email protected]>
hw/acpi_piix4.c

index 96f522233a8c79af918f22c8fefeb12eca9e44c1..6c908ff00b6f8a4828facee4a5f8bf2f354fd39e 100644 (file)
@@ -471,11 +471,13 @@ static void pciej_write(void *opaque, uint32_t addr, uint32_t val)
     BusState *bus = opaque;
     DeviceState *qdev, *next;
     PCIDevice *dev;
+    PCIDeviceInfo *info;
     int slot = ffs(val) - 1;
 
     QLIST_FOREACH_SAFE(qdev, &bus->children, sibling, next) {
         dev = DO_UPCAST(PCIDevice, qdev, qdev);
-        if (PCI_SLOT(dev->devfn) == slot) {
+        info = container_of(qdev->info, PCIDeviceInfo, qdev);
+        if (PCI_SLOT(dev->devfn) == slot && !info->no_hotplug) {
             qdev_free(qdev);
         }
     }
This page took 0.02946 seconds and 4 git commands to generate.