diff options
Diffstat (limited to 'meta/recipes-devtools/qemu/qemu/CVE-2018-18954.patch')
-rw-r--r-- | meta/recipes-devtools/qemu/qemu/CVE-2018-18954.patch | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/meta/recipes-devtools/qemu/qemu/CVE-2018-18954.patch b/meta/recipes-devtools/qemu/qemu/CVE-2018-18954.patch new file mode 100644 index 0000000000..9fe136455f --- /dev/null +++ b/meta/recipes-devtools/qemu/qemu/CVE-2018-18954.patch | |||
@@ -0,0 +1,50 @@ | |||
1 | From 3c9fd43da473a324f6cc7a0d3db58f651a2d262c Mon Sep 17 00:00:00 2001 | ||
2 | From: Prasad J Pandit <pjp@fedoraproject.org> | ||
3 | Date: Fri, 26 Oct 2018 18:03:58 +0530 | ||
4 | Subject: [PATCH] ppc/pnv: check size before data buffer access | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | While performing PowerNV memory r/w operations, the access length | ||
10 | 'sz' could exceed the data[4] buffer size. Add check to avoid OOB | ||
11 | access. | ||
12 | |||
13 | Reported-by: Moguofang <moguofang@huawei.com> | ||
14 | Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org> | ||
15 | Reviewed-by: Cédric Le Goater <clg@kaod.org> | ||
16 | Signed-off-by: David Gibson <david@gibson.dropbear.id.au> | ||
17 | |||
18 | CVE: CVE-2018-18954 | ||
19 | Upstream-Status: Backport | ||
20 | [https://git.qemu.org/?p=qemu.git;a=commit;h=d07945e78eb6b593cd17a4640c1fc9eb35e3245d] | ||
21 | |||
22 | Signed-off-by: Dan Tran <dantran@microsoft.com> | ||
23 | --- | ||
24 | hw/ppc/pnv_lpc.c | 8 +++++++- | ||
25 | 1 file changed, 7 insertions(+), 1 deletion(-) | ||
26 | |||
27 | diff --git a/hw/ppc/pnv_lpc.c b/hw/ppc/pnv_lpc.c | ||
28 | index d7721320a2..172a915cfc 100644 | ||
29 | --- a/hw/ppc/pnv_lpc.c | ||
30 | +++ b/hw/ppc/pnv_lpc.c | ||
31 | @@ -155,9 +155,15 @@ static void pnv_lpc_do_eccb(PnvLpcController *lpc, uint64_t cmd) | ||
32 | /* XXX Check for magic bits at the top, addr size etc... */ | ||
33 | unsigned int sz = (cmd & ECCB_CTL_SZ_MASK) >> ECCB_CTL_SZ_LSH; | ||
34 | uint32_t opb_addr = cmd & ECCB_CTL_ADDR_MASK; | ||
35 | - uint8_t data[4]; | ||
36 | + uint8_t data[8]; | ||
37 | bool success; | ||
38 | |||
39 | + if (sz > sizeof(data)) { | ||
40 | + qemu_log_mask(LOG_GUEST_ERROR, | ||
41 | + "ECCB: invalid operation at @0x%08x size %d\n", opb_addr, sz); | ||
42 | + return; | ||
43 | + } | ||
44 | + | ||
45 | if (cmd & ECCB_CTL_READ) { | ||
46 | success = opb_read(lpc, opb_addr, data, sz); | ||
47 | if (success) { | ||
48 | -- | ||
49 | 2.22.0.vfs.1.1.57.gbaf16c8 | ||
50 | |||