diff options
| author | Sakib Sajal <sakib.sajal@windriver.com> | 2021-08-23 21:27:40 -0700 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-09-01 16:27:09 +0100 |
| commit | 4ed9972582fc8cdfad5425e1952d7ce7590147cf (patch) | |
| tree | 748536c9b482b20629387b74e278733f9f69cdce | |
| parent | 4bd52d64c9581cc9a87a0b6b113575881566e5fc (diff) | |
| download | poky-4ed9972582fc8cdfad5425e1952d7ce7590147cf.tar.gz | |
qemu: fix CVE-2021-20257
Source: https://git.yoctoproject.org/git/poky
MR: 110290
Type: Security Fix
Disposition: Backport from http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/meta/recipes-devtools/qemu?h=hardknott&id=5c1a29e6deec8f92ac43363bd72439aec7e27721
ChangeID: 7f301e939cf9d1fdb826ac47d1fc96430086a68e
Description:
(From OE-Core rev: 5b66ff7972951db973d12f3dae6ccecf3bc29e56)
(From OE-Core rev: 1317053b23e1a4c1e5c7331a97f248e042415bea)
Signed-off-by: Sakib Sajal <sakib.sajal@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 547ac986a74cfcae39b691ebb92aadc8436443ea)
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 5c1a29e6deec8f92ac43363bd72439aec7e27721)
Signed-off-by: Armin Kuster <akuster@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/recipes-devtools/qemu/qemu.inc | 1 | ||||
| -rw-r--r-- | meta/recipes-devtools/qemu/qemu/CVE-2021-20257.patch | 55 |
2 files changed, 56 insertions, 0 deletions
diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc index e64a6b2cb2..1ddb373115 100644 --- a/meta/recipes-devtools/qemu/qemu.inc +++ b/meta/recipes-devtools/qemu/qemu.inc | |||
| @@ -71,6 +71,7 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \ | |||
| 71 | file://CVE-2021-3416_8.patch \ | 71 | file://CVE-2021-3416_8.patch \ |
| 72 | file://CVE-2021-3416_9.patch \ | 72 | file://CVE-2021-3416_9.patch \ |
| 73 | file://CVE-2021-3416_10.patch \ | 73 | file://CVE-2021-3416_10.patch \ |
| 74 | file://CVE-2021-20257.patch \ | ||
| 74 | " | 75 | " |
| 75 | UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar" | 76 | UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar" |
| 76 | 77 | ||
diff --git a/meta/recipes-devtools/qemu/qemu/CVE-2021-20257.patch b/meta/recipes-devtools/qemu/qemu/CVE-2021-20257.patch new file mode 100644 index 0000000000..7175b24e99 --- /dev/null +++ b/meta/recipes-devtools/qemu/qemu/CVE-2021-20257.patch | |||
| @@ -0,0 +1,55 @@ | |||
| 1 | From affdf476543405045c281a7c67d1eaedbcea8135 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Jason Wang <jasowang@redhat.com> | ||
| 3 | Date: Wed, 24 Feb 2021 13:45:28 +0800 | ||
| 4 | Subject: [PATCH] e1000: fail early for evil descriptor | ||
| 5 | |||
| 6 | During procss_tx_desc(), driver can try to chain data descriptor with | ||
| 7 | legacy descriptor, when will lead underflow for the following | ||
| 8 | calculation in process_tx_desc() for bytes: | ||
| 9 | |||
| 10 | if (tp->size + bytes > msh) | ||
| 11 | bytes = msh - tp->size; | ||
| 12 | |||
| 13 | This will lead a infinite loop. So check and fail early if tp->size if | ||
| 14 | greater or equal to msh. | ||
| 15 | |||
| 16 | Reported-by: Alexander Bulekov <alxndr@bu.edu> | ||
| 17 | Reported-by: Cheolwoo Myung <cwmyung@snu.ac.kr> | ||
| 18 | Reported-by: Ruhr-University Bochum <bugs-syssec@rub.de> | ||
| 19 | Cc: Prasad J Pandit <ppandit@redhat.com> | ||
| 20 | Cc: qemu-stable@nongnu.org | ||
| 21 | Signed-off-by: Jason Wang <jasowang@redhat.com> | ||
| 22 | |||
| 23 | Upstream-Status: Backport [3de46e6fc489c52c9431a8a832ad8170a7569bd8] | ||
| 24 | CVE: CVE-2021-20257 | ||
| 25 | |||
| 26 | Signed-off-by: Sakib Sajal <sakib.sajal@windriver.com> | ||
| 27 | --- | ||
| 28 | hw/net/e1000.c | 4 ++++ | ||
| 29 | 1 file changed, 4 insertions(+) | ||
| 30 | |||
| 31 | diff --git a/hw/net/e1000.c b/hw/net/e1000.c | ||
| 32 | index cf22c4f07..c3564c7ce 100644 | ||
| 33 | --- a/hw/net/e1000.c | ||
| 34 | +++ b/hw/net/e1000.c | ||
| 35 | @@ -670,6 +670,9 @@ process_tx_desc(E1000State *s, struct e1000_tx_desc *dp) | ||
| 36 | msh = tp->tso_props.hdr_len + tp->tso_props.mss; | ||
| 37 | do { | ||
| 38 | bytes = split_size; | ||
| 39 | + if (tp->size >= msh) { | ||
| 40 | + goto eop; | ||
| 41 | + } | ||
| 42 | if (tp->size + bytes > msh) | ||
| 43 | bytes = msh - tp->size; | ||
| 44 | |||
| 45 | @@ -695,6 +698,7 @@ process_tx_desc(E1000State *s, struct e1000_tx_desc *dp) | ||
| 46 | tp->size += split_size; | ||
| 47 | } | ||
| 48 | |||
| 49 | +eop: | ||
| 50 | if (!(txd_lower & E1000_TXD_CMD_EOP)) | ||
| 51 | return; | ||
| 52 | if (!(tp->cptse && tp->size < tp->tso_props.hdr_len)) { | ||
| 53 | -- | ||
| 54 | 2.29.2 | ||
| 55 | |||
