Skip to content

Commit e75cd05

Browse files
authored
[MEDIUM] Patch libvirt for CVE-2024-4418 (#13811)
1 parent 14bcb8f commit e75cd05

2 files changed

Lines changed: 49 additions & 1 deletion

File tree

SPECS/libvirt/CVE-2024-4418.patch

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
From e35fd05e2512a1c650b1940910bb394bfe8bd27d Mon Sep 17 00:00:00 2001
2+
From: Aninda <v-anipradhan@microsoft.com>
3+
Date: Thu, 15 May 2025 08:56:07 -0400
4+
Subject: [PATCH] Address CVE-2024-4418
5+
Upstream Patch Reference: https://gitlab.com/libvirt/libvirt/-/commit/8074d64dc2eca846d6a61efe1a9b7428a0ce1dd1
6+
---
7+
src/rpc/virnetclient.c | 14 +++++++++++++-
8+
1 file changed, 13 insertions(+), 1 deletion(-)
9+
10+
diff --git a/src/rpc/virnetclient.c b/src/rpc/virnetclient.c
11+
index 68098b1..147b0d6 100644
12+
--- a/src/rpc/virnetclient.c
13+
+++ b/src/rpc/virnetclient.c
14+
@@ -1657,7 +1657,7 @@ static int virNetClientIOEventLoop(virNetClient *client,
15+
#endif /* !WIN32 */
16+
int timeout = -1;
17+
virNetMessage *msg = NULL;
18+
- g_autoptr(GSource) G_GNUC_UNUSED source = NULL;
19+
+ g_autoptr(GSource) source = NULL;
20+
GIOCondition ev = 0;
21+
struct virNetClientIOEventData data = {
22+
.client = client,
23+
@@ -1721,6 +1721,18 @@ static int virNetClientIOEventLoop(virNetClient *client,
24+
25+
g_main_loop_run(client->eventLoop);
26+
27+
+ /*
28+
+ * If virNetClientIOEventFD ran, this GSource will already be
29+
+ * destroyed due to G_SOURCE_REMOVE. It is harmless to re-destroy
30+
+ * it, since we still own a reference.
31+
+ *
32+
+ * If virNetClientIOWakeup ran, it will have interrupted the
33+
+ * g_main_loop_run call, before virNetClientIOEventFD could
34+
+ * run, and thus the GSource is still registered, and we need
35+
+ * to destroy it since it is referencing stack memory for 'data'
36+
+ */
37+
+ g_source_destroy(source);
38+
+
39+
#ifndef WIN32
40+
ignore_value(pthread_sigmask(SIG_SETMASK, &oldmask, NULL));
41+
#endif /* !WIN32 */
42+
--
43+
2.34.1
44+

SPECS/libvirt/libvirt.spec

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@
185185
Summary: Library providing a simple virtualization API
186186
Name: libvirt
187187
Version: 10.0.0
188-
Release: 4%{?dist}
188+
Release: 5%{?dist}
189189
License: GPL-2.0-or-later AND LGPL-2.1-only AND LGPL-2.1-or-later AND OFL-1.1
190190
Vendor: Microsoft Corporation
191191
Distribution: Azure Linux
@@ -198,6 +198,7 @@ Source: https://download.libvirt.org/%{?mainturl}libvirt-%{version}.tar.
198198
Patch0: libvirt-conf.patch
199199
Patch1: CVE-2024-1441.patch
200200
Patch2: CVE-2024-2494.patch
201+
Patch3: CVE-2024-4418.patch
201202

202203
Requires: libvirt-daemon = %{version}-%{release}
203204
Requires: libvirt-daemon-config-network = %{version}-%{release}
@@ -2188,6 +2189,9 @@ exit 0
21882189
%endif
21892190

21902191
%changelog
2192+
* Thu May 15 2025 Aninda Pradhan <v-anipradhan@microsoft.com> - 10.0.0-5
2193+
- Fixes CVE-2024-4418 with an upstream patch
2194+
21912195
* Fri May 23 2025 Aninda Pradhan <v-anipradhan@microsoft.com> - 10.0.0-4
21922196
- Fix for CVE-2024-1441 and CVE-2024-2494
21932197

0 commit comments

Comments
 (0)