From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:52644) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QN1AD-0008Rr-FW for qemu-devel@nongnu.org; Thu, 19 May 2011 07:13:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QN1AC-0007Vt-7t for qemu-devel@nongnu.org; Thu, 19 May 2011 07:13:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:13229) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QN1AC-0007Vl-0u for qemu-devel@nongnu.org; Thu, 19 May 2011 07:13:08 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p4JBD5An020486 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 19 May 2011 07:13:06 -0400 Message-ID: <4DD4FB3A.1060600@redhat.com> Date: Thu, 19 May 2011 13:12:58 +0200 From: Gerd Hoffmann MIME-Version: 1.0 References: <1305796393-22786-1-git-send-email-kraxel@redhat.com> <1305796393-22786-2-git-send-email-kraxel@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: Markus Armbruster Cc: qemu-devel@nongnu.org Hi, >> 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()? Dunno, didn't look at q35 yet. I'd expect the root bus isn't hot-pluggable, so the guest wouldn't be able to rip out any essential chipset devices. But having someone more familier with pcie + q35 double-check would be good ... cheers, Gerd