summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/qemu
diff options
context:
space:
mode:
authorDavide Gardenal <davidegarde2000@gmail.com>2022-03-24 12:31:25 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-03-31 21:09:33 +0100
commitd69c49f33a8a280f97906dd87188c7d13ddbd5b7 (patch)
treeaa797f15775687e0223c54489a441c9e49e6ab30 /meta/recipes-devtools/qemu
parent513cfaa43dfbe3d4766c8a4b07f7a28690eea596 (diff)
downloadpoky-d69c49f33a8a280f97906dd87188c7d13ddbd5b7.tar.gz
qemu: backport patch fix for CVE-2020-13791
Upstream patch: https://lists.gnu.org/archive/html/qemu-devel/2020-06/msg00979.html CVE: CVE-2020-13791 (From OE-Core rev: 6d4e6302fa21b1c663b94b05088ecf9b9d544c0a) Signed-off-by: Davide Gardenal <davide.gardenal@huawei.com> Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/qemu')
-rw-r--r--meta/recipes-devtools/qemu/qemu.inc1
-rw-r--r--meta/recipes-devtools/qemu/qemu/CVE-2020-13791.patch44
2 files changed, 45 insertions, 0 deletions
diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc
index 0bdc917783..25c2cdef3a 100644
--- a/meta/recipes-devtools/qemu/qemu.inc
+++ b/meta/recipes-devtools/qemu/qemu.inc
@@ -97,6 +97,7 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \
97 file://CVE-2020-13253_3.patch \ 97 file://CVE-2020-13253_3.patch \
98 file://CVE-2020-13253_4.patch \ 98 file://CVE-2020-13253_4.patch \
99 file://CVE-2020-13253_5.patch \ 99 file://CVE-2020-13253_5.patch \
100 file://CVE-2020-13791.patch \
100 " 101 "
101UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar" 102UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar"
102 103
diff --git a/meta/recipes-devtools/qemu/qemu/CVE-2020-13791.patch b/meta/recipes-devtools/qemu/qemu/CVE-2020-13791.patch
new file mode 100644
index 0000000000..1e8278f7b7
--- /dev/null
+++ b/meta/recipes-devtools/qemu/qemu/CVE-2020-13791.patch
@@ -0,0 +1,44 @@
1Date: Thu, 4 Jun 2020 16:25:24 +0530
2From: Prasad J Pandit <pjp@fedoraproject.org>
3Subject: [PATCH v3] ati-vga: check address before reading configuration bytes (CVE-2020-13791)
4
5While reading PCI configuration bytes, a guest may send an
6address towards the end of the configuration space. It may lead
7to an OOB access issue. Add check to ensure 'address + size' is
8within PCI configuration space.
9
10CVE: CVE-2020-13791
11
12Upstream-Status: Submitted
13https://lists.gnu.org/archive/html/qemu-devel/2020-06/msg00979.html
14
15Reported-by: Ren Ding <rding@gatech.edu>
16Reported-by: Hanqing Zhao <hanqing@gatech.edu>
17Reported-by: Yi Ren <c4tren@gmail.com>
18Suggested-by: BALATON Zoltan <balaton@eik.bme.hu>
19Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
20Signed-off-by: Davide Gardenal <davide.gardenal@huawei.com>
21---
22 hw/display/ati.c | 4 +++-
23 1 file changed, 3 insertions(+), 1 deletion(-)
24
25Update v3: avoid modifying 'addr' variable
26 -> https://lists.gnu.org/archive/html/qemu-devel/2020-06/msg00834.html
27
28diff --git a/hw/display/ati.c b/hw/display/ati.c
29index 67604e68de..b4d0fd88b7 100644
30--- a/hw/display/ati.c
31+++ b/hw/display/ati.c
32@@ -387,7 +387,9 @@ static uint64_t ati_mm_read(void *opaque, hwaddr addr, unsigned int size)
33 val = s->regs.crtc_pitch;
34 break;
35 case 0xf00 ... 0xfff:
36- val = pci_default_read_config(&s->dev, addr - 0xf00, size);
37+ if ((addr - 0xf00) + size <= pci_config_size(&s->dev)) {
38+ val = pci_default_read_config(&s->dev, addr - 0xf00, size);
39+ }
40 break;
41 case CUR_OFFSET:
42 val = s->regs.cur_offset;
43--
442.26.2