summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChangqing Li <changqing.li@windriver.com>2018-11-02 14:08:45 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-11-07 23:08:54 +0000
commitcae6e5dc833e4726610c86d4ca8b26e97b54f14c (patch)
tree53e8969f039d968df9542c11db008373a8e84c67
parentd6d723665d5fabfa83ea7c88f688e372668e271c (diff)
downloadpoky-cae6e5dc833e4726610c86d4ca8b26e97b54f14c.tar.gz
qemu: fix for CVE-2018-10839
(From OE-Core rev: 5c2b164e1022c46f6bf541894429773c3dde7af2) Signed-off-by: Changqing Li <changqing.li@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-devtools/qemu/qemu/CVE-2018-10839.patch52
1 files changed, 52 insertions, 0 deletions
diff --git a/meta/recipes-devtools/qemu/qemu/CVE-2018-10839.patch b/meta/recipes-devtools/qemu/qemu/CVE-2018-10839.patch
new file mode 100644
index 0000000000..7e1e442a41
--- /dev/null
+++ b/meta/recipes-devtools/qemu/qemu/CVE-2018-10839.patch
@@ -0,0 +1,52 @@
1From fdc89e90fac40c5ca2686733df17b6423fb8d8fb Mon Sep 17 00:00:00 2001
2From: Jason Wang <jasowang@redhat.com>
3Date: Wed, 30 May 2018 13:08:15 +0800
4Subject: [PATCH] ne2000: fix possible out of bound access in ne2000_receive
5
6In ne2000_receive(), we try to assign size_ to size which converts
7from size_t to integer. This will cause troubles when size_ is greater
8INT_MAX, this will lead a negative value in size and it can then pass
9the check of size < MIN_BUF_SIZE which may lead out of bound access of
10for both buf and buf1.
11
12Fixing by converting the type of size to size_t.
13
14CC: qemu-stable@nongnu.org
15Reported-by: Daniel Shapira <daniel@twistlock.com>
16Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
17Signed-off-by: Jason Wang <jasowang@redhat.com>
18
19Upstream-Status: Backport [https://git.qemu.org/?p=qemu.git;a=commitdiff
20;h=fdc89e90fac40c5ca2686733df17b6423fb8d8fb#patch1]
21
22CVE: CVE-2018-10839
23
24Signed-off-by: Changqing Li <changqing.li@windriver.com>
25---
26 hw/net/ne2000.c | 4 ++--
27 1 file changed, 2 insertions(+), 2 deletions(-)
28
29diff --git a/hw/net/ne2000.c b/hw/net/ne2000.c
30index 07d79e3..869518e 100644
31--- a/hw/net/ne2000.c
32+++ b/hw/net/ne2000.c
33@@ -174,7 +174,7 @@ static int ne2000_buffer_full(NE2000State *s)
34 ssize_t ne2000_receive(NetClientState *nc, const uint8_t *buf, size_t size_)
35 {
36 NE2000State *s = qemu_get_nic_opaque(nc);
37- int size = size_;
38+ size_t size = size_;
39 uint8_t *p;
40 unsigned int total_len, next, avail, len, index, mcast_idx;
41 uint8_t buf1[60];
42@@ -182,7 +182,7 @@ ssize_t ne2000_receive(NetClientState *nc, const uint8_t *buf, size_t size_)
43 { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
44
45 #if defined(DEBUG_NE2000)
46- printf("NE2000: received len=%d\n", size);
47+ printf("NE2000: received len=%zu\n", size);
48 #endif
49
50 if (s->cmd & E8390_STOP || ne2000_buffer_full(s))
51--
521.8.3.1