diff options
| author | Sakib Sajal <sakib.sajal@windriver.com> | 2022-08-10 10:11:57 -0400 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-08-23 15:22:52 +0100 |
| commit | c2c7ab074159d8bca4b3819b290f0c24016a7128 (patch) | |
| tree | dbfedad95ec970ff7e3330ad1860490d34c61980 /meta/recipes-devtools | |
| parent | 73080b3372da2783c327378a3c1d668f0300b79f (diff) | |
| download | poky-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.inc | 1 | ||||
| -rw-r--r-- | meta/recipes-devtools/qemu/qemu/CVE-2021-4158.patch | 46 |
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 | " |
| 43 | UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar" | 44 | UPSTREAM_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 @@ | |||
| 1 | From a0b64c6d078acb9bcfae600e22bf99a9a7deca7c Mon Sep 17 00:00:00 2001 | ||
| 2 | From: "Michael S. Tsirkin" <mst@redhat.com> | ||
| 3 | Date: Tue, 21 Dec 2021 09:45:44 -0500 | ||
| 4 | Subject: [PATCH] acpi: validate hotplug selector on access | ||
| 5 | MIME-Version: 1.0 | ||
| 6 | Content-Type: text/plain; charset=UTF-8 | ||
| 7 | Content-Transfer-Encoding: 8bit | ||
| 8 | |||
| 9 | When bus is looked up on a pci write, we didn't | ||
| 10 | validate that the lookup succeeded. | ||
| 11 | Fuzzers thus can trigger QEMU crash by dereferencing the NULL | ||
| 12 | bus pointer. | ||
| 13 | |||
| 14 | Fixes: b32bd763a1 ("pci: introduce acpi-index property for PCI device") | ||
| 15 | Fixes: CVE-2021-4158 | ||
| 16 | Cc: "Igor Mammedov" <imammedo@redhat.com> | ||
| 17 | Fixes: https://gitlab.com/qemu-project/qemu/-/issues/770 | ||
| 18 | Signed-off-by: Michael S. Tsirkin <mst@redhat.com> | ||
| 19 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
| 20 | Reviewed-by: Ani Sinha <ani@anisinha.ca> | ||
| 21 | |||
| 22 | Upstream-Status: Backport [9bd6565ccee68f72d5012e24646e12a1c662827e] | ||
| 23 | CVE: CVE-2021-4158 | ||
| 24 | |||
| 25 | Signed-off-by: Sakib Sajal <sakib.sajal@windriver.com> | ||
| 26 | --- | ||
| 27 | hw/acpi/pcihp.c | 3 +++ | ||
| 28 | 1 file changed, 3 insertions(+) | ||
| 29 | |||
| 30 | diff --git a/hw/acpi/pcihp.c b/hw/acpi/pcihp.c | ||
| 31 | index 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 | -- | ||
| 45 | 2.33.0 | ||
| 46 | |||
