summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools
diff options
context:
space:
mode:
authorAshish Sharma <asharma@mvista.com>2023-09-06 16:38:26 +0530
committerSteve Sakoman <steve@sakoman.com>2023-09-15 03:47:11 -1000
commitb48424988af3fd3e82706e44d4831bf0e701f2be (patch)
tree2cddfa0ea32d02bd45d821f10ece6b13d60cd160 /meta/recipes-devtools
parent0485ee7a6b889f7161732435bb1136bd86954f44 (diff)
downloadpoky-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.inc1
-rw-r--r--meta/recipes-devtools/qemu/qemu/CVE-2023-3180.patch49
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 "
143UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar" 144UPSTREAM_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 @@
1From 9d38a8434721a6479fe03fb5afb150ca793d3980 Mon Sep 17 00:00:00 2001
2From: zhenwei pi <pizhenwei@bytedance.com>
3Date: Thu, 3 Aug 2023 10:43:13 +0800
4Subject: [PATCH] virtio-crypto: verify src&dst buffer length for sym request
5
6For symmetric algorithms, the length of ciphertext must be as same
7as the plaintext.
8The missing verification of the src_len and the dst_len in
9virtio_crypto_sym_op_helper() may lead buffer overflow/divulged.
10
11This patch is originally written by Yiming Tao for QEMU-SECURITY,
12resend it(a few changes of error message) in qemu-devel.
13
14Fixes: CVE-2023-3180
15Fixes: 04b9b37edda("virtio-crypto: add data queue processing handler")
16Cc: Gonglei <arei.gonglei@huawei.com>
17Cc: Mauro Matteo Cascella <mcascell@redhat.com>
18Cc: Yiming Tao <taoym@zju.edu.cn>
19Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
20Message-Id: <20230803024314.29962-2-pizhenwei@bytedance.com>
21Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
22Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
23
24Upstream-Status: Backport from [https://gitlab.com/qemu-project/qemu/-/commit/9d38a8434721a6479fe03fb5afb150ca793d3980]
25CVE: CVE-2023-3180
26Signed-off-by: Ashish Sharma <asharma@mvista.com>
27
28 hw/virtio/virtio-crypto.c | 5 +++++
29 1 file changed, 5 insertions(+)
30
31diff --git a/hw/virtio/virtio-crypto.c b/hw/virtio/virtio-crypto.c
32index 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--
48GitLab
49