diff options
| author | Archana Polampalli <archana.polampalli@windriver.com> | 2023-08-14 07:42:27 +0000 |
|---|---|---|
| committer | Steve Sakoman <steve@sakoman.com> | 2023-08-19 05:56:58 -1000 |
| commit | 0ffefc4b62d7f863885cecb6b1d7b54b42852255 (patch) | |
| tree | 0b5ce8857f3218999bb881d26d51c787f4870e62 /meta/recipes-devtools | |
| parent | ef8a18fd3b9a766ddf541b38832f11db95aee014 (diff) | |
| download | poky-0ffefc4b62d7f863885cecb6b1d7b54b42852255.tar.gz | |
qemu: fix CVE-2023-3180
A flaw was found in the QEMU virtual crypto device while handling data
encryption/decryption requests in virtio_crypto_handle_sym_req.
There is no check for the value of `src_len` and `dst_len` in
virtio_crypto_sym_op_helper, potentially leading to a heap buffer
overflow when the two values differ.
References:
https://nvd.nist.gov/vuln/detail/CVE-2023-3180
Upstream patches:
https://gitlab.com/qemu-project/qemu/-/commit/49f1e02bac166821c712534aaa775f50e1afe17f
(From OE-Core rev: de421cab92c49ba0f068eae9d6b458a0368fcd03)
Signed-off-by: Archana Polampalli <archana.polampalli@windriver.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 | 50 |
2 files changed, 51 insertions, 0 deletions
diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc index 3347a99e19..d77c376bb6 100644 --- a/meta/recipes-devtools/qemu/qemu.inc +++ b/meta/recipes-devtools/qemu/qemu.inc | |||
| @@ -99,6 +99,7 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \ | |||
| 99 | file://CVE-2023-2861.patch \ | 99 | file://CVE-2023-2861.patch \ |
| 100 | file://CVE-2020-14394.patch \ | 100 | file://CVE-2020-14394.patch \ |
| 101 | file://CVE-2023-3354.patch \ | 101 | file://CVE-2023-3354.patch \ |
| 102 | file://CVE-2023-3180.patch \ | ||
| 102 | " | 103 | " |
| 103 | UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar" | 104 | UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar" |
| 104 | 105 | ||
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..30080924c8 --- /dev/null +++ b/meta/recipes-devtools/qemu/qemu/CVE-2023-3180.patch | |||
| @@ -0,0 +1,50 @@ | |||
| 1 | From 49f1e02bac166821c712534aaa775f50e1afe17f 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 | (cherry picked from commit 9d38a8434721a6479fe03fb5afb150ca793d3980) | ||
| 24 | Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> | ||
| 25 | |||
| 26 | Upstream-Status: Backport [https://gitlab.com/qemu-project/qemu/-/commit/49f1e02bac166821c712534aaa775f50e1afe17f] | ||
| 27 | CVE: CVE-2023-3180 | ||
| 28 | Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com> | ||
| 29 | --- | ||
| 30 | hw/virtio/virtio-crypto.c | 5 +++++ | ||
| 31 | 1 file changed, 5 insertions(+) | ||
| 32 | |||
| 33 | diff --git a/hw/virtio/virtio-crypto.c b/hw/virtio/virtio-crypto.c | ||
| 34 | index a1d122b9aa..ccaa704530 100644 | ||
| 35 | --- a/hw/virtio/virtio-crypto.c | ||
| 36 | +++ b/hw/virtio/virtio-crypto.c | ||
| 37 | @@ -635,6 +635,11 @@ virtio_crypto_sym_op_helper(VirtIODevice *vdev, | ||
| 38 | return NULL; | ||
| 39 | } | ||
| 40 | |||
| 41 | + if (unlikely(src_len != dst_len)) { | ||
| 42 | + virtio_error(vdev, "sym request src len is different from dst len"); | ||
| 43 | + return NULL; | ||
| 44 | + } | ||
| 45 | + | ||
| 46 | max_len = (uint64_t)iv_len + aad_len + src_len + dst_len + hash_result_len; | ||
| 47 | if (unlikely(max_len > vcrypto->conf.max_size)) { | ||
| 48 | virtio_error(vdev, "virtio-crypto too big length"); | ||
| 49 | -- | ||
| 50 | 2.40.0 | ||
