diff options
author | Lee Chee Yang <chee.yang.lee@intel.com> | 2020-02-24 13:46:53 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-02-28 23:11:28 +0000 |
commit | 5c53d63d4ca02b61bee487128c1b1845f99001d5 (patch) | |
tree | ad974a8cf6e34783c1f54dfbc14647fed9399727 /meta/recipes-devtools | |
parent | 7d5a0e2558d9f603a604e64ba6f7f12ab552b3b1 (diff) | |
download | poky-5c53d63d4ca02b61bee487128c1b1845f99001d5.tar.gz |
qemu: Fix CVE-2020-1711
see https://git.qemu.org/?p=qemu.git;a=commit;h=693fd2acdf14dd86c0bf852610f1c2cca80a74dc
(From OE-Core rev: 66289b3ba800c1b9e74b35fd1af2f4825c698550)
Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools')
-rw-r--r-- | meta/recipes-devtools/qemu/qemu.inc | 3 | ||||
-rw-r--r-- | meta/recipes-devtools/qemu/qemu/CVE-2020-1711.patch | 64 |
2 files changed, 66 insertions, 1 deletions
diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc index a557e74e97..f26e722f43 100644 --- a/meta/recipes-devtools/qemu/qemu.inc +++ b/meta/recipes-devtools/qemu/qemu.inc | |||
@@ -29,7 +29,8 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \ | |||
29 | file://0010-configure-Add-pkg-config-handling-for-libgcrypt.patch \ | 29 | file://0010-configure-Add-pkg-config-handling-for-libgcrypt.patch \ |
30 | file://0011-hw-i386-pc-fix-regression-in-parsing-vga-cmdline-par.patch \ | 30 | file://0011-hw-i386-pc-fix-regression-in-parsing-vga-cmdline-par.patch \ |
31 | file://CVE-2019-15890.patch \ | 31 | file://CVE-2019-15890.patch \ |
32 | " | 32 | file://CVE-2020-1711.patch \ |
33 | " | ||
33 | UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar" | 34 | UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar" |
34 | 35 | ||
35 | SRC_URI[md5sum] = "278eeb294e4b497e79af7a57e660cb9a" | 36 | SRC_URI[md5sum] = "278eeb294e4b497e79af7a57e660cb9a" |
diff --git a/meta/recipes-devtools/qemu/qemu/CVE-2020-1711.patch b/meta/recipes-devtools/qemu/qemu/CVE-2020-1711.patch new file mode 100644 index 0000000000..aa7bc82329 --- /dev/null +++ b/meta/recipes-devtools/qemu/qemu/CVE-2020-1711.patch | |||
@@ -0,0 +1,64 @@ | |||
1 | From 693fd2acdf14dd86c0bf852610f1c2cca80a74dc Mon Sep 17 00:00:00 2001 | ||
2 | From: Felipe Franciosi <felipe@nutanix.com> | ||
3 | Date: Thu, 23 Jan 2020 12:44:59 +0000 | ||
4 | Subject: [PATCH] iscsi: Cap block count from GET LBA STATUS (CVE-2020-1711) | ||
5 | |||
6 | When querying an iSCSI server for the provisioning status of blocks (via | ||
7 | GET LBA STATUS), Qemu only validates that the response descriptor zero's | ||
8 | LBA matches the one requested. Given the SCSI spec allows servers to | ||
9 | respond with the status of blocks beyond the end of the LUN, Qemu may | ||
10 | have its heap corrupted by clearing/setting too many bits at the end of | ||
11 | its allocmap for the LUN. | ||
12 | |||
13 | A malicious guest in control of the iSCSI server could carefully program | ||
14 | Qemu's heap (by selectively setting the bitmap) and then smash it. | ||
15 | |||
16 | This limits the number of bits that iscsi_co_block_status() will try to | ||
17 | update in the allocmap so it can't overflow the bitmap. | ||
18 | |||
19 | Upstream-Status: Backport [https://git.qemu.org/?p=qemu.git;a=patch;h=693fd2acdf14dd86c0bf852610f1c2cca80a74dc] | ||
20 | CVE: CVE-2020-1711 | ||
21 | |||
22 | Fixes: CVE-2020-1711 | ||
23 | Cc: qemu-stable@nongnu.org | ||
24 | Signed-off-by: Felipe Franciosi <felipe@nutanix.com> | ||
25 | Signed-off-by: Peter Turschmid <peter.turschm@nutanix.com> | ||
26 | Signed-off-by: Raphael Norwitz <raphael.norwitz@nutanix.com> | ||
27 | Signed-off-by: Kevin Wolf <kwolf@redhat.com> | ||
28 | Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com> | ||
29 | --- | ||
30 | block/iscsi.c | 5 +++-- | ||
31 | 1 file changed, 3 insertions(+), 2 deletions(-) | ||
32 | |||
33 | diff --git a/block/iscsi.c b/block/iscsi.c | ||
34 | index 2aea7e3..cbd5729 100644 | ||
35 | --- a/block/iscsi.c | ||
36 | +++ b/block/iscsi.c | ||
37 | @@ -701,7 +701,7 @@ static int coroutine_fn iscsi_co_block_status(BlockDriverState *bs, | ||
38 | struct scsi_get_lba_status *lbas = NULL; | ||
39 | struct scsi_lba_status_descriptor *lbasd = NULL; | ||
40 | struct IscsiTask iTask; | ||
41 | - uint64_t lba; | ||
42 | + uint64_t lba, max_bytes; | ||
43 | int ret; | ||
44 | |||
45 | iscsi_co_init_iscsitask(iscsilun, &iTask); | ||
46 | @@ -721,6 +721,7 @@ static int coroutine_fn iscsi_co_block_status(BlockDriverState *bs, | ||
47 | } | ||
48 | |||
49 | lba = offset / iscsilun->block_size; | ||
50 | + max_bytes = (iscsilun->num_blocks - lba) * iscsilun->block_size; | ||
51 | |||
52 | qemu_mutex_lock(&iscsilun->mutex); | ||
53 | retry: | ||
54 | @@ -764,7 +765,7 @@ retry: | ||
55 | goto out_unlock; | ||
56 | } | ||
57 | |||
58 | - *pnum = (int64_t) lbasd->num_blocks * iscsilun->block_size; | ||
59 | + *pnum = MIN((int64_t) lbasd->num_blocks * iscsilun->block_size, max_bytes); | ||
60 | |||
61 | if (lbasd->provisioning == SCSI_PROVISIONING_TYPE_DEALLOCATED || | ||
62 | lbasd->provisioning == SCSI_PROVISIONING_TYPE_ANCHORED) { | ||
63 | -- | ||
64 | 1.8.3.1 | ||