[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 02/52] acpi: validate hotplug selector on access
From: |
Michael S. Tsirkin |
Subject: |
[PULL 02/52] acpi: validate hotplug selector on access |
Date: |
Thu, 6 Jan 2022 08:16:21 -0500 |
When bus is looked up on a pci write, we didn't
validate that the lookup succeeded.
Fuzzers thus can trigger QEMU crash by dereferencing the NULL
bus pointer.
Fixes: b32bd763a1 ("pci: introduce acpi-index property for PCI device")
Fixes: CVE-2021-4158
Cc: "Igor Mammedov" <imammedo@redhat.com>
Fixes: https://gitlab.com/qemu-project/qemu/-/issues/770
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Ani Sinha <ani@anisinha.ca>
---
hw/acpi/pcihp.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/hw/acpi/pcihp.c b/hw/acpi/pcihp.c
index 30405b5113..a5e182dd3a 100644
--- a/hw/acpi/pcihp.c
+++ b/hw/acpi/pcihp.c
@@ -491,6 +491,9 @@ static void pci_write(void *opaque, hwaddr addr, uint64_t
data,
}
bus = acpi_pcihp_find_hotplug_bus(s, s->hotplug_select);
+ if (!bus) {
+ break;
+ }
QTAILQ_FOREACH_SAFE(kid, &bus->qbus.children, sibling, next) {
Object *o = OBJECT(kid->child);
PCIDevice *dev = PCI_DEVICE(o);
--
MST
- [PULL 00/52] virtio,pci,pc: features,fixes,cleanups, Michael S. Tsirkin, 2022/01/06
- [PULL 01/52] virtio-mem: Don't skip alignment checks when warning about block size, Michael S. Tsirkin, 2022/01/06
- [PULL 02/52] acpi: validate hotplug selector on access,
Michael S. Tsirkin <=
- [PULL 03/52] virtio: introduce macro IRTIO_CONFIG_IRQ_IDX, Michael S. Tsirkin, 2022/01/06
- [PULL 06/52] vhost: introduce new VhostOps vhost_set_config_call, Michael S. Tsirkin, 2022/01/06
- [PULL 05/52] virtio-pci: decouple the single vector from the interrupt process, Michael S. Tsirkin, 2022/01/06
- [PULL 07/52] vhost-vdpa: add support for config interrupt, Michael S. Tsirkin, 2022/01/06
- [PULL 09/52] vhost: add support for configure interrupt, Michael S. Tsirkin, 2022/01/06
- [PULL 12/52] virtio-pci: add support for configure interrupt, Michael S. Tsirkin, 2022/01/06
- [PULL 08/52] virtio: add support for configure interrupt, Michael S. Tsirkin, 2022/01/06
- [PULL 10/52] virtio-net: add support for configure interrupt, Michael S. Tsirkin, 2022/01/06
- [PULL 11/52] virtio-mmio: add support for configure interrupt, Michael S. Tsirkin, 2022/01/06
- [PULL 13/52] trace-events,pci: unify trace events format, Michael S. Tsirkin, 2022/01/06