summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools
diff options
context:
space:
mode:
authorSakib Sajal <sakib.sajal@windriver.com>2022-08-10 10:11:57 -0400
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-08-23 15:22:52 +0100
commitc2c7ab074159d8bca4b3819b290f0c24016a7128 (patch)
treedbfedad95ec970ff7e3330ad1860490d34c61980 /meta/recipes-devtools
parent73080b3372da2783c327378a3c1d668f0300b79f (diff)
downloadpoky-c2c7ab074159d8bca4b3819b290f0c24016a7128.tar.gz
qemu: fix CVE-2021-4158
Backport patch to fix CVE-2021-4158. (From OE-Core rev: a171d1fa795ea41ef073f1ed34894d0c43989e6a) Signed-off-by: Sakib Sajal <sakib.sajal@windriver.com> Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools')
-rw-r--r--meta/recipes-devtools/qemu/qemu.inc1
-rw-r--r--meta/recipes-devtools/qemu/qemu/CVE-2021-4158.patch46
2 files changed, 47 insertions, 0 deletions
diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc
index 53bad5c453..1d04ad3c67 100644
--- a/meta/recipes-devtools/qemu/qemu.inc
+++ b/meta/recipes-devtools/qemu/qemu.inc
@@ -39,6 +39,7 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \
39 file://CVE-2021-3507_1.patch \ 39 file://CVE-2021-3507_1.patch \
40 file://CVE-2021-3507_2.patch \ 40 file://CVE-2021-3507_2.patch \
41 file://CVE-2021-3929.patch \ 41 file://CVE-2021-3929.patch \
42 file://CVE-2021-4158.patch \
42 " 43 "
43UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar" 44UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar"
44 45
diff --git a/meta/recipes-devtools/qemu/qemu/CVE-2021-4158.patch b/meta/recipes-devtools/qemu/qemu/CVE-2021-4158.patch
new file mode 100644
index 0000000000..f6de53244f
--- /dev/null
+++ b/meta/recipes-devtools/qemu/qemu/CVE-2021-4158.patch
@@ -0,0 +1,46 @@
1From a0b64c6d078acb9bcfae600e22bf99a9a7deca7c Mon Sep 17 00:00:00 2001
2From: "Michael S. Tsirkin" <mst@redhat.com>
3Date: Tue, 21 Dec 2021 09:45:44 -0500
4Subject: [PATCH] acpi: validate hotplug selector on access
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9When bus is looked up on a pci write, we didn't
10validate that the lookup succeeded.
11Fuzzers thus can trigger QEMU crash by dereferencing the NULL
12bus pointer.
13
14Fixes: b32bd763a1 ("pci: introduce acpi-index property for PCI device")
15Fixes: CVE-2021-4158
16Cc: "Igor Mammedov" <imammedo@redhat.com>
17Fixes: https://gitlab.com/qemu-project/qemu/-/issues/770
18Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
19Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
20Reviewed-by: Ani Sinha <ani@anisinha.ca>
21
22Upstream-Status: Backport [9bd6565ccee68f72d5012e24646e12a1c662827e]
23CVE: CVE-2021-4158
24
25Signed-off-by: Sakib Sajal <sakib.sajal@windriver.com>
26---
27 hw/acpi/pcihp.c | 3 +++
28 1 file changed, 3 insertions(+)
29
30diff --git a/hw/acpi/pcihp.c b/hw/acpi/pcihp.c
31index 30405b511..a5e182dd3 100644
32--- a/hw/acpi/pcihp.c
33+++ b/hw/acpi/pcihp.c
34@@ -491,6 +491,9 @@ static void pci_write(void *opaque, hwaddr addr, uint64_t data,
35 }
36
37 bus = acpi_pcihp_find_hotplug_bus(s, s->hotplug_select);
38+ if (!bus) {
39+ break;
40+ }
41 QTAILQ_FOREACH_SAFE(kid, &bus->qbus.children, sibling, next) {
42 Object *o = OBJECT(kid->child);
43 PCIDevice *dev = PCI_DEVICE(o);
44--
452.33.0
46