Received: from eggs.gnu.org ([140.186.70.92]:34313) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QN01f-0007dt-9M for qemu-devel@nongnu.org; Thu, 19 May 2011 06:00:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QN01e-0003tF-7s for qemu-devel@nongnu.org; Thu, 19 May 2011 06:00:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43299) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QN01e-0003sz-0g for qemu-devel@nongnu.org; Thu, 19 May 2011 06:00:14 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p4JA085d029802 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 19 May 2011 06:00:13 -0400 From: Markus Armbruster References: <1305796393-22786-1-git-send-email-kraxel@redhat.com> <1305796393-22786-2-git-send-email-kraxel@redhat.com> Date: Thu, 19 May 2011 12:00:06 +0200 In-Reply-To: <1305796393-22786-2-git-send-email-kraxel@redhat.com> (Gerd Hoffmann's message of "Thu, 19 May 2011 11:13:13 +0200") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [Qemu-devel] [PATCH] Ignore pci unplug requests for unpluggable devices (CVE-2011-1751) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: qemu-devel@nongnu.org Gerd Hoffmann writes: > 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 > --- > hw/acpi_piix4.c | 4 +++- > 1 files changed, 3 insertions(+), 1 deletions(-) > > diff --git a/hw/acpi_piix4.c b/hw/acpi_piix4.c > index 96f5222..6c908ff 100644 > --- a/hw/acpi_piix4.c > +++ b/hw/acpi_piix4.c > @@ -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); > } > } Looks good, but what about pcie_cap_slot_hotplug()?