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