Bug 2031527 - An invalid pointer initialization issue was found in /hw/acpi/pcihp.c:470:9 of QEMU in versions 6.2.0-rc2.
Summary: An invalid pointer initialization issue was found in /hw/acpi/pcihp.c:470:9 o...
Keywords:
Status: NEW
Alias: None
Product: Fedora EPEL
Classification: Fedora
Component: qemu
Version: epel9
Hardware: Unspecified
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Lubomir Rintel
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 2032920 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-12-12 15:40 UTC by Dike
Modified: 2023-11-04 07:19 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)
Steps to Reproduce (4.88 KB, text/plain)
2021-12-12 15:40 UTC, Dike
no flags Details

Description Dike 2021-12-12 15:40:21 UTC
Created attachment 1845942 [details]
Steps to Reproduce

Created attachment 1845942 [details]
Steps to Reproduce

Description of problem:
An invalid pointer initialization issue was found in /hw/acpi/pcihp.c:470:9 of QEMU in versions 6.2.0-rc2.Successful exploitation of this vulnerability could lead to disclosure of sensitive information, addition or modification of data, or Denial of Service (DoS).

Version-Release number of selected component (if applicable):
6.2.0-rc2

How reproducible:
https://gitlab.com/qemu-project/qemu/-/issues/770

Steps to Reproduce:
https://gitlab.com/qemu-project/qemu/-/issues/770

Actual results:
disclosure of sensitive information, addition or modification of data, or Denial of Service (DoS)

Expected results:
Remote code execution

Upstream issue:
https://gitlab.com/qemu-project/qemu/-/issues/770

Comment 1 Dike 2021-12-14 02:48:59 UTC
This vulnerability is caused by the lax inspection of bus variables in function pci_write of /hw/acpi/pcihp.c. In this function, bus may be NULL. 
It may be fixed by this:

@@ -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);


This patch is provided by qemu team. After my local test, the patched program does not crash due to the same input.

Comment 2 Philippe Mathieu-Daudé 2021-12-15 13:43:11 UTC
*** Bug 2032920 has been marked as a duplicate of this bug. ***


Note You need to log in before you can comment on or make changes to this bug.