Skip to content

Commit e901709

Browse files
authored
libvirt: address CVE-2024-1441 (#8447)
Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
1 parent 7dea67d commit e901709

2 files changed

Lines changed: 45 additions & 1 deletion

File tree

SPECS/libvirt/CVE-2024-1441.patch

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
From 95f07e1b298f7a89df79334512fed9d15abd17a1 Mon Sep 17 00:00:00 2001
2+
From: Martin Kletzander <mkletzan@redhat.com>
3+
Date: Tue, 27 Feb 2024 16:20:12 +0100
4+
Subject: [PATCH] Fix off-by-one error in udevListInterfacesByStatus
5+
MIME-Version: 1.0
6+
Content-Type: text/plain; charset=UTF-8
7+
Content-Transfer-Encoding: 8bit
8+
9+
Ever since this function was introduced in 2012 it could've tried
10+
filling in an extra interface name. That was made worse in 2019 when
11+
the caller functions started accepting NULL arrays of size 0.
12+
13+
This is assigned CVE-2024-1441.
14+
15+
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
16+
Reported-by: Alexander Kuznetsov <kuznetsovam@altlinux.org>
17+
Fixes: 5a33366f5c0b18c93d161bd144f9f079de4ac8ca
18+
Fixes: d6064e2759a24e0802f363e3a810dc5a7d7ebb15
19+
Reviewed-by: Ján Tomko <jtomko@redhat.com>
20+
Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
21+
---
22+
src/interface/interface_backend_udev.c | 2 +-
23+
1 file changed, 1 insertion(+), 1 deletion(-)
24+
25+
diff --git a/src/interface/interface_backend_udev.c b/src/interface/interface_backend_udev.c
26+
index 8c41771..5b22a60 100644
27+
--- a/src/interface/interface_backend_udev.c
28+
+++ b/src/interface/interface_backend_udev.c
29+
@@ -220,7 +220,7 @@ udevListInterfacesByStatus(virConnectPtr conn,
30+
g_autoptr(virInterfaceDef) def = NULL;
31+
32+
/* Ensure we won't exceed the size of our array */
33+
- if (count > names_len)
34+
+ if (count >= names_len)
35+
break;
36+
37+
path = udev_list_entry_get_name(dev_entry);
38+
--
39+
2.40.1
40+

SPECS/libvirt/libvirt.spec

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
Summary: Virtualization API library that supports KVM, QEMU, Xen, ESX etc
1010
Name: libvirt
1111
Version: 7.10.0
12-
Release: 6%{?dist}
12+
Release: 7%{?dist}
1313
License: LGPLv2+
1414
Vendor: Microsoft Corporation
1515
Distribution: Mariner
@@ -18,6 +18,7 @@ URL: https://libvirt.org/
1818
Source0: https://libvirt.org/sources/%{name}-%{version}.tar.xz
1919
# CVE-2023-2700 is fixed by https://gitlab.com/libvirt/libvirt/-/commit/6425a311b8ad19d6f9c0b315bf1d722551ea3585
2020
Patch1: CVE-2023-2700.patch
21+
Patch2: CVE-2024-1441.patch
2122

2223
BuildRequires: audit-libs-devel
2324
BuildRequires: augeas
@@ -1055,6 +1056,9 @@ exit 0
10551056
%{_libdir}/libnss_libvirt_guest.so.2
10561057

10571058
%changelog
1059+
* Tue Mar 19 2024 Muhammad Falak <mwani@microsoft.com> - 7.10.0-7
1060+
- Introduce patch to address CVE-2024-1441
1061+
10581062
* Wed Jan 17 2024 Harshit Gupta <guptaharshit@microsoft.com> - 7.10.0-6
10591063
- Release bump with no changes to force a rebuild and consume new libssh2 build
10601064

0 commit comments

Comments
 (0)