diff options
-rw-r--r-- | meta/recipes-devtools/qemu/qemu.inc | 1 | ||||
-rw-r--r-- | meta/recipes-devtools/qemu/qemu/CVE-2020-16092.patch | 49 |
2 files changed, 50 insertions, 0 deletions
diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc index 5cdba1f02c..e686b24e80 100644 --- a/meta/recipes-devtools/qemu/qemu.inc +++ b/meta/recipes-devtools/qemu/qemu.inc | |||
@@ -39,6 +39,7 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \ | |||
39 | file://CVE-2020-11869.patch \ | 39 | file://CVE-2020-11869.patch \ |
40 | file://CVE-2020-13765.patch \ | 40 | file://CVE-2020-13765.patch \ |
41 | file://CVE-2020-10702.patch \ | 41 | file://CVE-2020-10702.patch \ |
42 | file://CVE-2020-16092.patch \ | ||
42 | " | 43 | " |
43 | UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar" | 44 | UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar" |
44 | 45 | ||
diff --git a/meta/recipes-devtools/qemu/qemu/CVE-2020-16092.patch b/meta/recipes-devtools/qemu/qemu/CVE-2020-16092.patch new file mode 100644 index 0000000000..8ce01e26ad --- /dev/null +++ b/meta/recipes-devtools/qemu/qemu/CVE-2020-16092.patch | |||
@@ -0,0 +1,49 @@ | |||
1 | From 035e69b063835a5fd23cacabd63690a3d84532a8 Mon Sep 17 00:00:00 2001 | ||
2 | From: Mauro Matteo Cascella <mcascell@redhat.com> | ||
3 | Date: Sat, 1 Aug 2020 18:42:38 +0200 | ||
4 | Subject: [PATCH] hw/net/net_tx_pkt: fix assertion failure in | ||
5 | net_tx_pkt_add_raw_fragment() | ||
6 | |||
7 | An assertion failure issue was found in the code that processes network | ||
8 | packets | ||
9 | while adding data fragments into the packet context. It could be abused | ||
10 | by a | ||
11 | malicious guest to abort the QEMU process on the host. This patch | ||
12 | replaces the | ||
13 | affected assert() with a conditional statement, returning false if the | ||
14 | current | ||
15 | data fragment exceeds max_raw_frags. | ||
16 | |||
17 | Reported-by: Alexander Bulekov <alxndr@bu.edu> | ||
18 | Reported-by: Ziming Zhang <ezrakiez@gmail.com> | ||
19 | Reviewed-by: Dmitry Fleytman <dmitry.fleytman@gmail.com> | ||
20 | Signed-off-by: Mauro Matteo Cascella <mcascell@redhat.com> | ||
21 | Signed-off-by: Jason Wang <jasowang@redhat.com> | ||
22 | |||
23 | Upstream-Status: Backport | ||
24 | CVE: CVE-2020-16092 | ||
25 | [https://git.qemu.org/?p=qemu.git;a=commit;h=035e69b063835a5fd23cacabd63690a3d84532a8] | ||
26 | Signed-off-by: Li Wang <li.wang@windriver.com> | ||
27 | --- | ||
28 | hw/net/net_tx_pkt.c | 5 ++++- | ||
29 | 1 file changed, 4 insertions(+), 1 deletion(-) | ||
30 | |||
31 | diff --git a/hw/net/net_tx_pkt.c b/hw/net/net_tx_pkt.c | ||
32 | index 162f802..54d4c3b 100644 | ||
33 | --- a/hw/net/net_tx_pkt.c | ||
34 | +++ b/hw/net/net_tx_pkt.c | ||
35 | @@ -379,7 +379,10 @@ bool net_tx_pkt_add_raw_fragment(struct NetTxPkt *pkt, hwaddr pa, | ||
36 | hwaddr mapped_len = 0; | ||
37 | struct iovec *ventry; | ||
38 | assert(pkt); | ||
39 | - assert(pkt->max_raw_frags > pkt->raw_frags); | ||
40 | + | ||
41 | + if (pkt->raw_frags >= pkt->max_raw_frags) { | ||
42 | + return false; | ||
43 | + } | ||
44 | |||
45 | if (!len) { | ||
46 | return true; | ||
47 | -- | ||
48 | 2.17.1 | ||
49 | |||