public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/libvirt] f43: CVE-2026-18917 (bz #2520165)
@ 2026-10-26 20:07 Cole Robinson
  0 siblings, 0 replies; only message in thread
From: Cole Robinson @ 2026-10-26 20:07 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/libvirt
Branch : f43
Commit : f7d94978f39392a107c96d259a66e6c149bc2f0c
Author : Cole Robinson <crobinso@redhat.com>
Date   : 2026-10-26T16:04:39-04:00
Stats  : +73/-1 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/libvirt/c/f7d94978f39392a107c96d259a66e6c149bc2f0c?branch=f43

Log:
CVE-2026-18917 (bz #2520165)

---
diff --git a/0001-remote-Fix-integer-overflow-in-RPC-handler-for-virNo.patch b/0001-remote-Fix-integer-overflow-in-RPC-handler-for-virNo.patch
new file mode 100644
index 0000000..82f9a81
--- /dev/null
+++ b/0001-remote-Fix-integer-overflow-in-RPC-handler-for-virNo.patch
@@ -0,0 +1,67 @@
+From b2ea1ef7240dd5e3ab77c549214a08d935fec337 Mon Sep 17 00:00:00 2001
+Message-ID: <b2ea1ef7240dd5e3ab77c549214a08d935fec337.1793044199.git.crobinso@redhat.com>
+From: Peter Krempa <pkrempa@redhat.com>
+Date: Wed, 12 Aug 2026 16:51:58 +0200
+Subject: [PATCH] remote: Fix integer overflow in RPC handler for
+ virNodeGetFreePages (CVE-2026-18917)
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+CVE-2026-18917
+
+The RPC handler 'remoteDispatchNodeGetFreePages' multiplies the 'npages'
+argument with the 'cellcount' argument passed to 'virNodeGetFreePages',
+both of which are declared as 'unsigned int' to both do an RPC limit
+check against the 'REMOTE_NODE_MAX_CELLS' constant and then to allocate
+the memory to hold the result from the actual hypervisor driver.
+
+Since both the values are 'unsigned int' the product is also unsigned
+int so big enough numbers can overflow, both passing the check and also
+allocating not enough memory for the result. The hypervisor driver
+assumes that the passed buffer is large enough and overwrites memory.
+
+When this happens the the hypervisor daemon crashes.
+
+This can be triggered e.g. by passing 1023 and 4198405 as values which
+multiply to 1019 after wrapping to 32 bit unsigned value.
+
+Use the VIR_INT_MULTIPLY_OVERFLOW macro in the check to avoid the issue
+the same way as we do for other APIs doing multiplication of arguments
+to determine amount of required memory.
+
+Fixes: 34f2d0319d2098c77c8cc27d8350616029125a2b (v1.2.5-164-g34f2d0319d)
+Closes: https://gitlab.com/libvirt/libvirt/-/work_items/903
+Signed-off-by: Peter Krempa <pkrempa@redhat.com>
+Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
+Signed-off-by: Cole Robinson <crobinso@redhat.com>
+---
+ src/remote/remote_daemon_dispatch.c | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/src/remote/remote_daemon_dispatch.c b/src/remote/remote_daemon_dispatch.c
+index 95ab173b7c..e548438250 100644
+--- a/src/remote/remote_daemon_dispatch.c
++++ b/src/remote/remote_daemon_dispatch.c
+@@ -6752,13 +6752,14 @@ remoteDispatchNodeGetFreePages(virNetServer *server G_GNUC_UNUSED,
+     if (!conn)
+         goto cleanup;
+ 
+-    if (args->pages.pages_len * args->cellCount > REMOTE_NODE_MAX_CELLS) {
+-        virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+-                       _("the result won't fit into REMOTE_NODE_MAX_CELLS"));
++    if (VIR_INT_MULTIPLY_OVERFLOW(args->pages.pages_len, args->cellCount) ||
++        args->pages.pages_len * args->cellCount > REMOTE_NODE_MAX_CELLS) {
++        virReportError(VIR_ERR_INTERNAL_ERROR,
++                       _("npages * cellcount > REMOTE_NODE_MAX_CELLS (%1$u)"),
++                       REMOTE_NODE_MAX_CELLS);
+         goto cleanup;
+     }
+ 
+-    /* Allocate return buffer. */
+     ret->counts.counts_val = g_new0(uint64_t,
+                                     args->pages.pages_len * args->cellCount);
+ 
+-- 
+2.56.0
+

diff --git a/libvirt.spec b/libvirt.spec
index 4d4ac8d..791892f 100644
--- a/libvirt.spec
+++ b/libvirt.spec
@@ -291,7 +291,7 @@
 Summary: Library providing a simple virtualization API
 Name: libvirt
 Version: 11.6.0
-Release: 3%{?dist}
+Release: 4%{?dist}
 License: GPL-2.0-or-later AND LGPL-2.1-only AND LGPL-2.1-or-later AND OFL-1.1
 URL: https://libvirt.org/
 
@@ -308,6 +308,8 @@ Patch: 0005-wireshark-Don-t-special-case-retval-of-get_program_d.patch
 Patch: 0006-wireshark-Introduce-and-use-vir_val_to_str.patch
 Patch: 0007-wireshark-Don-t-leak-column-strings.patch
 Patch: 0008-wireshark-Adapt-to-wireshark-4.6.0.patch
+# CVE-2026-18917 (bz #2520165)
+Patch: 0001-remote-Fix-integer-overflow-in-RPC-handler-for-virNo.patch
 
 
 Requires: libvirt-daemon = %{version}-%{release}
@@ -2705,6 +2707,9 @@ exit 0
 
 
 %changelog
+* Mon Oct 26 2026 Cole Robinson <crobinso@redhat.com> - 11.6.0-4
+- CVE-2026-18917 (bz #2520165)
+
 * Mon Feb 16 2026 Daniel P. Berrangé <berrange@redhat.com> - 11.6.0-3
 - Re-enable ZFS (rhbz#2407005)
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-10-26 20:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-26 20:07 [rpms/libvirt] f43: CVE-2026-18917 (bz #2520165) Cole Robinson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox