summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/qemu/qemu/CVE-2020-13791.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/qemu/qemu/CVE-2020-13791.patch')
-rw-r--r--meta/recipes-devtools/qemu/qemu/CVE-2020-13791.patch44
1 files changed, 44 insertions, 0 deletions
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