Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions SPECS/qemu/CVE-2021-4158.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
From 9bd6565ccee68f72d5012e24646e12a1c662827e Mon Sep 17 00:00:00 2001
From: "Michael S. Tsirkin" <[email protected]>
Date: Tue, 21 Dec 2021 09:45:44 -0500
Subject: [PATCH] acpi: validate hotplug selector on access
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

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" <[email protected]>
Fixes: https://gitlab.com/qemu-project/qemu/-/issues/770
Signed-off-by: Michael S. Tsirkin <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Ani Sinha <[email protected]>
---
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);
--
GitLab

7 changes: 6 additions & 1 deletion SPECS/qemu/qemu.spec
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ Obsoletes: %{name}-system-unicore32-core <= %{version}-%{release}
Summary: QEMU is a FAST! processor emulator
Name: qemu
Version: 6.2.0
Release: 6%{?dist}
Release: 7%{?dist}
License: BSD AND CC-BY AND GPLv2+ AND LGPLv2+ AND MIT
Vendor: Microsoft Corporation
Distribution: Mariner
Expand Down Expand Up @@ -257,6 +257,8 @@ Patch1003: CVE-2022-26354.patch
Patch1004: CVE-2022-26353.patch
Patch1005: CVE-2021-4206.patch
Patch1006: CVE-2022-35414.patch
# CVE-2021-4158 is fixed in 7.0.0 by https://gitlab.com/qemu-project/qemu/-/commit/9bd6565ccee68f72d5012e24646e12a1c662827e
Patch1007: CVE-2021-4158.patch

# alsa audio output
BuildRequires: alsa-lib-devel
Expand Down Expand Up @@ -2283,6 +2285,9 @@ useradd -r -u 107 -g qemu -G kvm -d / -s %{_sbindir}/nologin \


%changelog
* Tue Sep 06 2022 Daniel McIlvaney <[email protected]> - 6.2.0-7
- Patched CVE-2021-4158

* Tue Aug 23 2022 Nicolas Guibourge <[email protected]> - 6.2.0-6
- address CVE-2022-35414

Expand Down