Skip to content

Commit 66ba569

Browse files
[AutoPR- Security] Patch qemu for CVE-2026-3842 [HIGH] (#18055)
Co-authored-by: Akarsh Chaudhary <v-akarshc@microsoft.com>
1 parent 87345f5 commit 66ba569

2 files changed

Lines changed: 73 additions & 1 deletion

File tree

SPECS/qemu/CVE-2026-3842.patch

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
From f52056b4fdf5f43b1513168443617bd479e5233f Mon Sep 17 00:00:00 2001
2+
From: AllSpark <allspark@microsoft.com>
3+
Date: Mon, 20 Jul 2026 05:56:28 +0000
4+
Subject: [PATCH] hyperv/syndbg: check length returned by
5+
cpu_physical_memory_map()
6+
7+
Signed-off-by: Azure Linux Security Servicing Account <azurelinux-security@microsoft.com>
8+
Upstream-reference: AI Backport of https://gitlab.com/qemu-project/qemu/-/commit/85af4e937016ed2f20122eb116597d1abb30c5c0.patch
9+
---
10+
hw/hyperv/syndbg.c | 23 +++++++++++------------
11+
1 file changed, 11 insertions(+), 12 deletions(-)
12+
13+
diff --git a/hw/hyperv/syndbg.c b/hw/hyperv/syndbg.c
14+
index 065e12fb1..9fdec1146 100644
15+
--- a/hw/hyperv/syndbg.c
16+
+++ b/hw/hyperv/syndbg.c
17+
@@ -189,7 +189,7 @@ static uint16_t handle_recv_msg(HvSynDbg *syndbg, uint64_t outgpa,
18+
{
19+
uint16_t ret;
20+
uint8_t data_buf[TARGET_PAGE_SIZE - UDP_PKT_HEADER_SIZE];
21+
- hwaddr out_len;
22+
+ hwaddr out_len, out_requested_len;
23+
void *out_data;
24+
ssize_t recv_byte_count;
25+
26+
@@ -218,29 +218,28 @@ static uint16_t handle_recv_msg(HvSynDbg *syndbg, uint64_t outgpa,
27+
if (is_raw) {
28+
out_len += UDP_PKT_HEADER_SIZE;
29+
}
30+
+ out_requested_len = out_len;
31+
out_data = cpu_physical_memory_map(outgpa, &out_len, 1);
32+
- if (!out_data) {
33+
- return HV_STATUS_INSUFFICIENT_MEMORY;
34+
+ ret = HV_STATUS_INSUFFICIENT_MEMORY;
35+
+ if (!out_data || out_len < out_requested_len) {
36+
+ goto cleanup_out_data;
37+
}
38+
39+
if (is_raw &&
40+
- !create_udp_pkt(syndbg, out_data,
41+
- recv_byte_count + UDP_PKT_HEADER_SIZE,
42+
+ !create_udp_pkt(syndbg, out_data, out_len,
43+
data_buf, recv_byte_count)) {
44+
- ret = HV_STATUS_INSUFFICIENT_MEMORY;
45+
goto cleanup_out_data;
46+
} else if (!is_raw) {
47+
- memcpy(out_data, data_buf, recv_byte_count);
48+
+ memcpy(out_data, data_buf, out_len);
49+
}
50+
51+
- *retrieved_count = recv_byte_count;
52+
- if (is_raw) {
53+
- *retrieved_count += UDP_PKT_HEADER_SIZE;
54+
- }
55+
+ *retrieved_count = out_len;
56+
ret = HV_STATUS_SUCCESS;
57+
58+
cleanup_out_data:
59+
- cpu_physical_memory_unmap(out_data, out_len, 1, out_len);
60+
+ if (out_data) {
61+
+ cpu_physical_memory_unmap(out_data, out_len, 1, out_len);
62+
+ }
63+
return ret;
64+
}
65+
66+
--
67+
2.43.0
68+

SPECS/qemu/qemu.spec

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ Obsoletes: sgabios-bin <= 1:0.20180715git-10.fc38
432432
Summary: QEMU is a FAST! processor emulator
433433
Name: qemu
434434
Version: 9.1.0
435-
Release: 10%{?dist}
435+
Release: 11%{?dist}
436436
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
437437
URL: http://www.qemu.org/
438438

@@ -473,6 +473,7 @@ Patch30: kvm-migration-Fix-UAF-for-incoming-migration-on-Migratio.patch
473473
Patch31: CVE-2026-3195.patch
474474
Patch32: CVE-2026-48914.patch
475475
Patch33: CVE-2026-3196.patch
476+
Patch34: CVE-2026-3842.patch
476477

477478
Source10: qemu-guest-agent.service
478479
Source11: 99-qemu-guest-agent.rules
@@ -3522,6 +3523,9 @@ fi
35223523
# endif !tools_only
35233524
%endif
35243525
%changelog
3526+
* Mon Jul 20 2026 Azure Linux Security Servicing Account <azurelinux-security@microsoft.com> - 9.1.0-11
3527+
- Patch for CVE-2026-3842
3528+
35253529
* Wed Jul 01 2026 Azure Linux Security Servicing Account <azurelinux-security@microsoft.com> - 9.1.0-10
35263530
- Patch for CVE-2026-3196
35273531

0 commit comments

Comments
 (0)