summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/qemu/qemu/CVE-2020-29443.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/qemu/qemu/CVE-2020-29443.patch')
-rw-r--r--meta/recipes-devtools/qemu/qemu/CVE-2020-29443.patch46
1 files changed, 46 insertions, 0 deletions
diff --git a/meta/recipes-devtools/qemu/qemu/CVE-2020-29443.patch b/meta/recipes-devtools/qemu/qemu/CVE-2020-29443.patch
new file mode 100644
index 0000000000..5a3b99bb23
--- /dev/null
+++ b/meta/recipes-devtools/qemu/qemu/CVE-2020-29443.patch
@@ -0,0 +1,46 @@
1
2m 813212288970c39b1800f63e83ac6e96588095c6 Mon Sep 17 00:00:00 2001
3From: Paolo Bonzini <pbonzini@redhat.com>
4Date: Tue, 1 Dec 2020 13:09:26 +0100
5Subject: [PATCH] ide: atapi: assert that the buffer pointer is in range
6
7A case was reported where s->io_buffer_index can be out of range.
8The report skimped on the details but it seems to be triggered
9by s->lba == -1 on the READ/READ CD paths (e.g. by sending an
10ATAPI command with LBA = 0xFFFFFFFF). For now paper over it
11with assertions. The first one ensures that there is no overflow
12when incrementing s->io_buffer_index, the second checks for the
13buffer overrun.
14
15Note that the buffer overrun is only a read, so I am not sure
16if the assertion failure is actually less harmful than the overrun.
17
18Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
19Message-id: 20201201120926.56559-1-pbonzini@redhat.com
20Reviewed-by: Kevin Wolf <kwolf@redhat.com>
21Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
22
23Upstream-Status: Backport [https://git.qemu.org/?p=qemu.git;a=patch;h=813212288970c39b1800f63e83ac6e96588095c6]
24CVE: CVE-2020-29443
25Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
26
27---
28 hw/ide/atapi.c | 2 ++
29 1 file changed, 2 insertions(+)
30
31diff --git a/hw/ide/atapi.c b/hw/ide/atapi.c
32index 14a2b0b..e791578 100644
33--- a/hw/ide/atapi.c
34+++ b/hw/ide/atapi.c
35@@ -276,6 +276,8 @@ void ide_atapi_cmd_reply_end(IDEState *s)
36 s->packet_transfer_size -= size;
37 s->elementary_transfer_size -= size;
38 s->io_buffer_index += size;
39+ assert(size <= s->io_buffer_total_len);
40+ assert(s->io_buffer_index <= s->io_buffer_total_len);
41
42 /* Some adapters process PIO data right away. In that case, we need
43 * to avoid mutual recursion between ide_transfer_start
44--
451.8.3.1
46