diff options
author | Li Wang <li.wang@windriver.com> | 2020-08-18 04:48:17 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-09-10 13:21:41 +0100 |
commit | a76794a159e729b8f0abd121189bfc3ee9b490ec (patch) | |
tree | f7c0bedbd6dcb7d9f6e3f02f5ffff7f652878752 /meta/recipes-devtools/qemu/qemu/CVE-2020-16092.patch | |
parent | f65146f02f898c01cf79263abdee5afc3c062046 (diff) | |
download | poky-a76794a159e729b8f0abd121189bfc3ee9b490ec.tar.gz |
qemu: CVE-2020-16092
Backport CVE patch from the upstream:
https://git.qemu.org/?p=qemu.git;a=commit;h=035e69b063835a5fd23cacabd63690a3d84532a8
(From OE-Core rev: ffb65dd34fce4c75b9aa00dc0197bf83198a9980)
Signed-off-by: Li Wang <li.wang@windriver.com>
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/qemu/qemu/CVE-2020-16092.patch')
-rw-r--r-- | meta/recipes-devtools/qemu/qemu/CVE-2020-16092.patch | 49 |
1 files changed, 49 insertions, 0 deletions
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 | |||