Skip to content

Commit e33721f

Browse files
[AutoPR- Security] Patch qemu for CVE-2025-14876, CVE-2024-8354 [MEDIUM] (#16173)
1 parent f09813c commit e33721f

3 files changed

Lines changed: 130 additions & 1 deletion

File tree

SPECS/qemu/CVE-2024-8354.patch

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
From 3f96bd7f8f0e77baa3d0d8cf8847e35ce1f2a646 Mon Sep 17 00:00:00 2001
2+
From: Peter Maydell <peter.maydell@linaro.org>
3+
Date: Mon, 15 Sep 2025 14:29:10 +0100
4+
Subject: [PATCH] hw/usb/hcd-uhci: don't assert for SETUP to non-0 endpoint
5+
6+
If the guest feeds invalid data to the UHCI controller, we
7+
can assert:
8+
qemu-system-x86_64: ../../hw/usb/core.c:744: usb_ep_get: Assertion `pid == USB_TOKEN_IN || pid == USB_TOKEN_OUT' failed.
9+
10+
(see issue 2548 for the repro case). This happens because the guest
11+
attempts USB_TOKEN_SETUP to an endpoint other than 0, which is not
12+
valid. The controller code doesn't catch this guest error, so
13+
instead we hit the assertion in the USB core code.
14+
15+
Catch the case of SETUP to non-zero endpoint, and treat it as a fatal
16+
error in the TD, in the same way we do for an invalid PID value in
17+
the TD.
18+
19+
This is the UHCI equivalent of the same bug in OHCI that we fixed in
20+
commit 3c3c233677 ("hw/usb/hcd-ohci: Fix #1510, #303: pid not IN or
21+
OUT").
22+
23+
This bug has been tracked as CVE-2024-8354.
24+
25+
Cc: qemu-stable@nongnu.org
26+
Fixes: https://gitlab.com/qemu-project/qemu/-/issues/2548
27+
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
28+
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
29+
Signed-off-by: rpm-build <rpm-build>
30+
Upstream-reference: https://github.com/qemu/qemu/commit/d0af3cd0274e265435170a583c72b9f0a4100dff.patch
31+
---
32+
hw/usb/hcd-uhci.c | 10 ++++++++--
33+
1 file changed, 8 insertions(+), 2 deletions(-)
34+
35+
diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c
36+
index a03cf22..42d34f0 100644
37+
--- a/hw/usb/hcd-uhci.c
38+
+++ b/hw/usb/hcd-uhci.c
39+
@@ -724,6 +724,7 @@ static int uhci_handle_td(UHCIState *s, UHCIQueue *q, uint32_t qh_addr,
40+
bool spd;
41+
bool queuing = (q != NULL);
42+
uint8_t pid = td->token & 0xff;
43+
+ uint8_t ep_id = (td->token >> 15) & 0xf;
44+
UHCIAsync *async;
45+
46+
async = uhci_async_find_td(s, td_addr);
47+
@@ -767,9 +768,14 @@ static int uhci_handle_td(UHCIState *s, UHCIQueue *q, uint32_t qh_addr,
48+
49+
switch (pid) {
50+
case USB_TOKEN_OUT:
51+
- case USB_TOKEN_SETUP:
52+
case USB_TOKEN_IN:
53+
break;
54+
+ case USB_TOKEN_SETUP:
55+
+ /* SETUP is only valid to endpoint 0 */
56+
+ if (ep_id == 0) {
57+
+ break;
58+
+ }
59+
+ /* fallthrough */
60+
default:
61+
/* invalid pid : frame interrupted */
62+
s->status |= UHCI_STS_HCPERR;
63+
@@ -816,7 +822,7 @@ static int uhci_handle_td(UHCIState *s, UHCIQueue *q, uint32_t qh_addr,
64+
return uhci_handle_td_error(s, td, td_addr, USB_RET_NODEV,
65+
int_mask);
66+
}
67+
- ep = usb_ep_get(dev, pid, (td->token >> 15) & 0xf);
68+
+ ep = usb_ep_get(dev, pid, ep_id);
69+
q = uhci_queue_new(s, qh_addr, td, ep);
70+
}
71+
async = uhci_async_alloc(q, td_addr);
72+
--
73+
2.45.4
74+

SPECS/qemu/CVE-2025-14876.patch

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
From 7f06bba748f806932804cf7617b566cfcefe849f Mon Sep 17 00:00:00 2001
2+
From: zhenwei pi <pizhenwei@tensorfer.com>
3+
Date: Sun, 21 Dec 2025 10:43:20 +0800
4+
Subject: [PATCH] hw/virtio/virtio-crypto: verify asym request size
5+
MIME-Version: 1.0
6+
Content-Type: text/plain; charset=UTF-8
7+
Content-Transfer-Encoding: 8bit
8+
9+
The total lenght of request is limited by cryptodev config, verify it
10+
to avoid unexpected request from guest.
11+
12+
Fixes: CVE-2025-14876
13+
Fixes: 0e660a6f90a ("crypto: Introduce RSA algorithm")
14+
Reported-by: 이재영 <nakamurajames123@gmail.com>
15+
Signed-off-by: zhenwei pi <zhenwei.pi@linux.dev>
16+
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
17+
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
18+
Message-Id: <20251221024321.143196-2-zhenwei.pi@linux.dev>
19+
Signed-off-by: rpm-build <rpm-build>
20+
Upstream-reference: https://github.com/qemu/qemu/commit/91c6438caffc880e999a7312825479685d659b44.patch
21+
---
22+
hw/virtio/virtio-crypto.c | 7 +++++++
23+
1 file changed, 7 insertions(+)
24+
25+
diff --git a/hw/virtio/virtio-crypto.c b/hw/virtio/virtio-crypto.c
26+
index 5034768..5e5c9cd 100644
27+
--- a/hw/virtio/virtio-crypto.c
28+
+++ b/hw/virtio/virtio-crypto.c
29+
@@ -767,11 +767,18 @@ virtio_crypto_handle_asym_req(VirtIOCrypto *vcrypto,
30+
uint32_t len;
31+
uint8_t *src = NULL;
32+
uint8_t *dst = NULL;
33+
+ uint64_t max_len;
34+
35+
asym_op_info = g_new0(CryptoDevBackendAsymOpInfo, 1);
36+
src_len = ldl_le_p(&req->para.src_data_len);
37+
dst_len = ldl_le_p(&req->para.dst_data_len);
38+
39+
+ max_len = (uint64_t)src_len + dst_len;
40+
+ if (unlikely(max_len > vcrypto->conf.max_size)) {
41+
+ virtio_error(vdev, "virtio-crypto asym request is too large");
42+
+ goto err;
43+
+ }
44+
+
45+
if (src_len > 0) {
46+
src = g_malloc0(src_len);
47+
len = iov_to_buf(iov, out_num, 0, src, src_len);
48+
--
49+
2.45.4
50+

SPECS/qemu/qemu.spec

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ Obsoletes: sgabios-bin <= 1:0.20180715git-10.fc38
435435
Summary: QEMU is a FAST! processor emulator
436436
Name: qemu
437437
Version: 9.1.0
438-
Release: 1%{?dist}
438+
Release: 2%{?dist}
439439
License: Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND FSFAP AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-2.0-or-later WITH GCC-exception-2.0 AND LGPL-2.0-only AND LGPL-2.0-or-later AND LGPL-2.1-only AND LGPL-2.1-or-later AND MIT AND LicenseRef-Fedora-Public-Domain AND CC-BY-3.0
440440
URL: http://www.qemu.org/
441441

@@ -448,6 +448,8 @@ Patch2: 0002-Disable-failing-tests-on-azl.patch
448448
Patch3: CVE-2021-20255.patch
449449
Patch4: CVE-2025-11234.patch
450450
Patch5: CVE-2025-12464.patch
451+
Patch6: CVE-2024-8354.patch
452+
Patch7: CVE-2025-14876.patch
451453

452454
Source10: qemu-guest-agent.service
453455
Source11: 99-qemu-guest-agent.rules
@@ -3407,6 +3409,9 @@ useradd -r -u 107 -g qemu -G kvm -d / -s /sbin/nologin \
34073409

34083410

34093411
%changelog
3412+
* Wed Mar 11 2026 Azure Linux Security Servicing Account <azurelinux-security@microsoft.com> - 9.1.0-2
3413+
- Patch for CVE-2025-14876, CVE-2024-8354
3414+
34103415
* Fri Feb 06 2026 Aadhar Agarwal <aadagarwal@microsoft.com> - 9.1.0-1
34113416
- Upgrade to QEMU 9.1.0
34123417
- Remove CVE patches merged upstream: CVE-2023-6683, CVE-2023-6693,

0 commit comments

Comments
 (0)