diff options
author | Ashish Sharma <asharma@mvista.com> | 2023-09-06 16:38:26 +0530 |
---|---|---|
committer | Steve Sakoman <steve@sakoman.com> | 2023-09-15 03:47:11 -1000 |
commit | b48424988af3fd3e82706e44d4831bf0e701f2be (patch) | |
tree | 2cddfa0ea32d02bd45d821f10ece6b13d60cd160 /meta/recipes-devtools | |
parent | 0485ee7a6b889f7161732435bb1136bd86954f44 (diff) | |
download | poky-b48424988af3fd3e82706e44d4831bf0e701f2be.tar.gz |
qemu: Backport fix CVE-2023-3180
Upstream-Status: Backport from [https://gitlab.com/qemu-project/qemu/-/commit/9d38a8434721a6479fe03fb5afb150ca793d3980]
CVE: CVE-2023-3180
(From OE-Core rev: edbc17315927a711aa9fae7c6cfba61cbf8ab5ad)
Signed-off-by: Ashish Sharma <asharma@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta/recipes-devtools')
-rw-r--r-- | meta/recipes-devtools/qemu/qemu.inc | 1 | ||||
-rw-r--r-- | meta/recipes-devtools/qemu/qemu/CVE-2023-3180.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 2871818cb1..3789d77046 100644 --- a/meta/recipes-devtools/qemu/qemu.inc +++ b/meta/recipes-devtools/qemu/qemu.inc | |||
@@ -139,6 +139,7 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \ | |||
139 | file://hw-display-qxl-Pass-requested-buffer-size-to-qxl_phy.patch \ | 139 | file://hw-display-qxl-Pass-requested-buffer-size-to-qxl_phy.patch \ |
140 | file://CVE-2023-0330.patch \ | 140 | file://CVE-2023-0330.patch \ |
141 | file://CVE-2023-3354.patch \ | 141 | file://CVE-2023-3354.patch \ |
142 | file://CVE-2023-3180.patch \ | ||
142 | " | 143 | " |
143 | UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar" | 144 | UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar" |
144 | 145 | ||
diff --git a/meta/recipes-devtools/qemu/qemu/CVE-2023-3180.patch b/meta/recipes-devtools/qemu/qemu/CVE-2023-3180.patch new file mode 100644 index 0000000000..7144bdca46 --- /dev/null +++ b/meta/recipes-devtools/qemu/qemu/CVE-2023-3180.patch | |||
@@ -0,0 +1,49 @@ | |||
1 | From 9d38a8434721a6479fe03fb5afb150ca793d3980 Mon Sep 17 00:00:00 2001 | ||
2 | From: zhenwei pi <pizhenwei@bytedance.com> | ||
3 | Date: Thu, 3 Aug 2023 10:43:13 +0800 | ||
4 | Subject: [PATCH] virtio-crypto: verify src&dst buffer length for sym request | ||
5 | |||
6 | For symmetric algorithms, the length of ciphertext must be as same | ||
7 | as the plaintext. | ||
8 | The missing verification of the src_len and the dst_len in | ||
9 | virtio_crypto_sym_op_helper() may lead buffer overflow/divulged. | ||
10 | |||
11 | This patch is originally written by Yiming Tao for QEMU-SECURITY, | ||
12 | resend it(a few changes of error message) in qemu-devel. | ||
13 | |||
14 | Fixes: CVE-2023-3180 | ||
15 | Fixes: 04b9b37edda("virtio-crypto: add data queue processing handler") | ||
16 | Cc: Gonglei <arei.gonglei@huawei.com> | ||
17 | Cc: Mauro Matteo Cascella <mcascell@redhat.com> | ||
18 | Cc: Yiming Tao <taoym@zju.edu.cn> | ||
19 | Signed-off-by: zhenwei pi <pizhenwei@bytedance.com> | ||
20 | Message-Id: <20230803024314.29962-2-pizhenwei@bytedance.com> | ||
21 | Reviewed-by: Michael S. Tsirkin <mst@redhat.com> | ||
22 | Signed-off-by: Michael S. Tsirkin <mst@redhat.com> | ||
23 | |||
24 | Upstream-Status: Backport from [https://gitlab.com/qemu-project/qemu/-/commit/9d38a8434721a6479fe03fb5afb150ca793d3980] | ||
25 | CVE: CVE-2023-3180 | ||
26 | Signed-off-by: Ashish Sharma <asharma@mvista.com> | ||
27 | |||
28 | hw/virtio/virtio-crypto.c | 5 +++++ | ||
29 | 1 file changed, 5 insertions(+) | ||
30 | |||
31 | diff --git a/hw/virtio/virtio-crypto.c b/hw/virtio/virtio-crypto.c | ||
32 | index 44faf5a522b..13aec771e11 100644 | ||
33 | --- a/hw/virtio/virtio-crypto.c | ||
34 | +++ b/hw/virtio/virtio-crypto.c | ||
35 | @@ -634,6 +634,11 @@ virtio_crypto_sym_op_helper(VirtIODevice *vdev, | ||
36 | return NULL; | ||
37 | } | ||
38 | |||
39 | + if (unlikely(src_len != dst_len)) { | ||
40 | + virtio_error(vdev, "sym request src len is different from dst len"); | ||
41 | + return NULL; | ||
42 | + } | ||
43 | + | ||
44 | max_len = (uint64_t)iv_len + aad_len + src_len + dst_len + hash_result_len; | ||
45 | if (unlikely(max_len > vcrypto->conf.max_size)) { | ||
46 | virtio_error(vdev, "virtio-crypto too big length"); | ||
47 | -- | ||
48 | GitLab | ||
49 | |||