Skip to content

Commit 71a0307

Browse files
[AUTO-CHERRYPICK] Patch cloud-hypervisor for CVE-2025-1744 [Critical] - branch main (#12860)
Co-authored-by: Kanishk Bansal <103916909+Kanishk-Bansal@users.noreply.github.com>
1 parent fbff078 commit 71a0307

2 files changed

Lines changed: 37 additions & 1 deletion

File tree

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
From b49d2f0b84d424ec7fbf47138bf6acc6b18e1b0d Mon Sep 17 00:00:00 2001
2+
From: tabudz <tanb74653@gmail.com>
3+
Date: Tue, 18 Feb 2025 11:28:15 +0800
4+
Subject: [PATCH] Fix a bug when getting a gzip header extra field with
5+
inflate(). If the extra field was larger than the space the user provided
6+
with inflateGetHeader(), and if multiple calls of inflate() delivered the
7+
extra header data, then there could be a buffer overflow of the provided
8+
space. This commit assures that provided space is not exceeded.
9+
10+
Upstream Reference: https://github.com/radareorg/radare2/pull/23969/commits/b49d2f0b84d424ec7fbf47138bf6acc6b18e1b0d
11+
---
12+
inflate.c | 5 +++--
13+
1 file changed, 3 insertions(+), 2 deletions(-)
14+
15+
diff --git a/inflate.c b/inflate.c
16+
index e9ed74cff3279..2ecfb4876d155 100644
17+
--- a/inflate.c
18+
+++ b/inflate.c
19+
@@ -755,9 +755,10 @@ int ZEXPORT inflate(z_streamp strm, int flush)
20+
copy = state->length;
21+
if (copy > have) copy = have;
22+
if (copy) {
23+
+ len = state->head->extra_len - state->length;
24+
if (state->head != Z_NULL &&
25+
- state->head->extra != Z_NULL) {
26+
- len = state->head->extra_len - state->length;
27+
+ state->head->extra != Z_NULL &&
28+
+ len < state->head->extra_max) {
29+
zmemcpy(state->head->extra + len, next,
30+
len + copy > state->head->extra_max ?
31+
state->head->extra_max - len : copy);

SPECS/cloud-hypervisor/cloud-hypervisor.spec

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Summary: Cloud Hypervisor is an open source Virtual Machine Monitor (VMM) that runs on top of KVM.
66
Name: cloud-hypervisor
77
Version: 32.0
8-
Release: 4%{?dist}
8+
Release: 5%{?dist}
99
License: ASL 2.0 OR BSD-3-clause
1010
Vendor: Microsoft Corporation
1111
Distribution: Mariner
@@ -26,6 +26,7 @@ Patch0: CVE-2023-45853.patch
2626
Patch1: CVE-2023-50711-vmm-sys-util.patch
2727
Patch2: CVE-2023-50711-vhost.patch
2828
Patch3: CVE-2023-50711-versionize.patch
29+
Patch4: CVE-2025-1744.patch
2930
%endif
3031

3132
Conflicts: cloud-hypervisor-cvm
@@ -80,6 +81,7 @@ Cloud Hypervisor is an open source Virtual Machine Monitor (VMM) that runs on to
8081
tar xf %{SOURCE1}
8182
pushd vendor/libz-sys/src/zlib
8283
%patch0 -p1
84+
%patch4 -p1
8385
popd
8486
%patch1 -p1
8587
%patch2 -p1
@@ -164,6 +166,9 @@ cargo build --release --target=%{rust_musl_target} --package vhost_user_block %{
164166
%license LICENSE-BSD-3-Clause
165167

166168
%changelog
169+
* Tue Mar 04 2024 Kanishk Bansal <kanbansal@microsoft.com> - 32.0-4
170+
- Patch CVE-2025-1744
171+
167172
* Mon May 20 2024 Saul Paredes <saulparedes@microsoft.com> - 32.0-4
168173
- Add conflicts with cloud-hypervisor-cvm
169174

0 commit comments

Comments
 (0)