diff options
| author | Hitendra Prajapati <hprajapati@mvista.com> | 2022-07-27 12:23:25 +0530 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-08-04 16:29:15 +0100 |
| commit | caae799d638b70b4f3a3ff199f6c9ee8a3984526 (patch) | |
| tree | a8e153c5b71e833c6b5b6492202c4d3a4e5ac098 /meta | |
| parent | 27fde9cc2aeddb9ea964efb4cc2de7c608256777 (diff) | |
| download | poky-caae799d638b70b4f3a3ff199f6c9ee8a3984526.tar.gz | |
qemu: CVE-2022-35414 can perform an uninitialized read on the translate_fail path, leading to an io_readx or io_writex crash
Source: https://github.com/qemu/qemu
MR: 119830
Type: Security Fix
Disposition: Backport from https://github.com/qemu/qemu/commit/418ade7849ce7641c0f7333718caf5091a02fd4c
ChangeID: 41d6646e06319e629da574b9b2e8a3a197a73441
Description:
CVE-2022-35414 qemu: can perform an uninitialized read on the translate_fail path, leading to an io_readx or io_writex crash.
(From OE-Core rev: 5f236e744b5b528bdf8d95c9580c273f63c04452)
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
| -rw-r--r-- | meta/recipes-devtools/qemu/qemu.inc | 1 | ||||
| -rw-r--r-- | meta/recipes-devtools/qemu/qemu/CVE-2022-35414.patch | 53 |
2 files changed, 54 insertions, 0 deletions
diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc index 63f0569d06..54a68e1730 100644 --- a/meta/recipes-devtools/qemu/qemu.inc +++ b/meta/recipes-devtools/qemu/qemu.inc | |||
| @@ -35,6 +35,7 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \ | |||
| 35 | file://pvrdma.patch \ | 35 | file://pvrdma.patch \ |
| 36 | file://CVE-2021-4206.patch \ | 36 | file://CVE-2021-4206.patch \ |
| 37 | file://CVE-2021-4207.patch \ | 37 | file://CVE-2021-4207.patch \ |
| 38 | file://CVE-2022-35414.patch \ | ||
| 38 | " | 39 | " |
| 39 | UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar" | 40 | UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar" |
| 40 | 41 | ||
diff --git a/meta/recipes-devtools/qemu/qemu/CVE-2022-35414.patch b/meta/recipes-devtools/qemu/qemu/CVE-2022-35414.patch new file mode 100644 index 0000000000..3786497f01 --- /dev/null +++ b/meta/recipes-devtools/qemu/qemu/CVE-2022-35414.patch | |||
| @@ -0,0 +1,53 @@ | |||
| 1 | From ee76e64ee1cb232b77652b21cc94ec6b6c7e4b13 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Hitendra Prajapati <hprajapati@mvista.com> | ||
| 3 | Date: Wed, 27 Jul 2022 10:49:47 +0530 | ||
| 4 | Subject: [PATCH] CVE-2022-35414 | ||
| 5 | |||
| 6 | Upstream-Status: Backport [https://github.com/qemu/qemu/commit/418ade7849ce7641c0f7333718caf5091a02fd4c] | ||
| 7 | CVE: CVE-2022-35414 | ||
| 8 | Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com> | ||
| 9 | --- | ||
| 10 | softmmu/physmem.c | 13 ++++++++++++- | ||
| 11 | 1 file changed, 12 insertions(+), 1 deletion(-) | ||
| 12 | |||
| 13 | diff --git a/softmmu/physmem.c b/softmmu/physmem.c | ||
| 14 | index 3524c04c2..3c467527d 100644 | ||
| 15 | --- a/softmmu/physmem.c | ||
| 16 | +++ b/softmmu/physmem.c | ||
| 17 | @@ -667,7 +667,7 @@ void tcg_iommu_init_notifier_list(CPUState *cpu) | ||
| 18 | |||
| 19 | /* Called from RCU critical section */ | ||
| 20 | MemoryRegionSection * | ||
| 21 | -address_space_translate_for_iotlb(CPUState *cpu, int asidx, hwaddr addr, | ||
| 22 | +address_space_translate_for_iotlb(CPUState *cpu, int asidx, hwaddr orig_addr, | ||
| 23 | hwaddr *xlat, hwaddr *plen, | ||
| 24 | MemTxAttrs attrs, int *prot) | ||
| 25 | { | ||
| 26 | @@ -676,6 +676,7 @@ address_space_translate_for_iotlb(CPUState *cpu, int asidx, hwaddr addr, | ||
| 27 | IOMMUMemoryRegionClass *imrc; | ||
| 28 | IOMMUTLBEntry iotlb; | ||
| 29 | int iommu_idx; | ||
| 30 | + hwaddr addr = orig_addr; | ||
| 31 | AddressSpaceDispatch *d = | ||
| 32 | qatomic_rcu_read(&cpu->cpu_ases[asidx].memory_dispatch); | ||
| 33 | |||
| 34 | @@ -720,6 +721,16 @@ address_space_translate_for_iotlb(CPUState *cpu, int asidx, hwaddr addr, | ||
| 35 | return section; | ||
| 36 | |||
| 37 | translate_fail: | ||
| 38 | + /* | ||
| 39 | + * We should be given a page-aligned address -- certainly | ||
| 40 | + * tlb_set_page_with_attrs() does so. The page offset of xlat | ||
| 41 | + * is used to index sections[], and PHYS_SECTION_UNASSIGNED = 0. | ||
| 42 | + * The page portion of xlat will be logged by memory_region_access_valid() | ||
| 43 | + * when this memory access is rejected, so use the original untranslated | ||
| 44 | + * physical address. | ||
| 45 | + */ | ||
| 46 | + assert((orig_addr & ~TARGET_PAGE_MASK) == 0); | ||
| 47 | + *xlat = orig_addr; | ||
| 48 | return &d->map.sections[PHYS_SECTION_UNASSIGNED]; | ||
| 49 | } | ||
| 50 | |||
| 51 | -- | ||
| 52 | 2.25.1 | ||
| 53 | |||
