|
| 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 | + |
0 commit comments