diff --git a/0003-virpci-Resolve-leak-in-virPCIVirtualFunctionList-cle.patch b/0003-virpci-Resolve-leak-in-virPCIVirtualFunctionList-cle.patch deleted file mode 100644 index babe037..0000000 --- a/0003-virpci-Resolve-leak-in-virPCIVirtualFunctionList-cle.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 6425a311b8ad19d6f9c0b315bf1d722551ea3585 Mon Sep 17 00:00:00 2001 -From: Tim Shearer -Date: Mon, 1 May 2023 13:15:48 +0000 -Subject: [PATCH] virpci: Resolve leak in virPCIVirtualFunctionList cleanup -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Repeatedly querying an SR-IOV PCI device's capabilities exposes a -memory leak caused by a failure to free the virPCIVirtualFunction -array within the parent struct's g_autoptr cleanup. - -Valgrind output after getting a single interface's XML description -1000 times: - -==325982== 256,000 bytes in 1,000 blocks are definitely lost in loss record 2,634 of 2,635 -==325982== at 0x4C3C096: realloc (vg_replace_malloc.c:1437) -==325982== by 0x59D952D: g_realloc (in /usr/lib64/libglib-2.0.so.0.5600.4) -==325982== by 0x4EE1F52: virReallocN (viralloc.c:52) -==325982== by 0x4EE1FB7: virExpandN (viralloc.c:78) -==325982== by 0x4EE219A: virInsertElementInternal (viralloc.c:183) -==325982== by 0x4EE23B2: virAppendElement (viralloc.c:288) -==325982== by 0x4F65D85: virPCIGetVirtualFunctionsFull (virpci.c:2389) -==325982== by 0x4F65753: virPCIGetVirtualFunctions (virpci.c:2256) -==325982== by 0x505CB75: virNodeDeviceGetPCISRIOVCaps (node_device_conf.c:2969) -==325982== by 0x505D181: virNodeDeviceGetPCIDynamicCaps (node_device_conf.c:3099) -==325982== by 0x505BC4E: virNodeDeviceUpdateCaps (node_device_conf.c:2677) -==325982== by 0x260FCBB2: nodeDeviceGetXMLDesc (node_device_driver.c:355) - -Signed-off-by: Tim Shearer -Reviewed-by: Ján Tomko -Signed-off-by: Han Han ---- - src/util/virpci.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/src/util/virpci.c b/src/util/virpci.c -index 9e564e4a4f..cc2b07bbba 100644 ---- a/src/util/virpci.c -+++ b/src/util/virpci.c -@@ -2245,6 +2245,7 @@ virPCIVirtualFunctionListFree(virPCIVirtualFunctionList *list) - g_free(list->functions[i].ifname); - } - -+ g_free(list->functions); - g_free(list); - } - --- -2.41.0 - diff --git a/0004-virpci-Resolve-leak-in-virPCIVirtualFunctionList-cle.patch b/0004-virpci-Resolve-leak-in-virPCIVirtualFunctionList-cle.patch new file mode 100644 index 0000000..babe037 --- /dev/null +++ b/0004-virpci-Resolve-leak-in-virPCIVirtualFunctionList-cle.patch @@ -0,0 +1,51 @@ +From 6425a311b8ad19d6f9c0b315bf1d722551ea3585 Mon Sep 17 00:00:00 2001 +From: Tim Shearer +Date: Mon, 1 May 2023 13:15:48 +0000 +Subject: [PATCH] virpci: Resolve leak in virPCIVirtualFunctionList cleanup +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Repeatedly querying an SR-IOV PCI device's capabilities exposes a +memory leak caused by a failure to free the virPCIVirtualFunction +array within the parent struct's g_autoptr cleanup. + +Valgrind output after getting a single interface's XML description +1000 times: + +==325982== 256,000 bytes in 1,000 blocks are definitely lost in loss record 2,634 of 2,635 +==325982== at 0x4C3C096: realloc (vg_replace_malloc.c:1437) +==325982== by 0x59D952D: g_realloc (in /usr/lib64/libglib-2.0.so.0.5600.4) +==325982== by 0x4EE1F52: virReallocN (viralloc.c:52) +==325982== by 0x4EE1FB7: virExpandN (viralloc.c:78) +==325982== by 0x4EE219A: virInsertElementInternal (viralloc.c:183) +==325982== by 0x4EE23B2: virAppendElement (viralloc.c:288) +==325982== by 0x4F65D85: virPCIGetVirtualFunctionsFull (virpci.c:2389) +==325982== by 0x4F65753: virPCIGetVirtualFunctions (virpci.c:2256) +==325982== by 0x505CB75: virNodeDeviceGetPCISRIOVCaps (node_device_conf.c:2969) +==325982== by 0x505D181: virNodeDeviceGetPCIDynamicCaps (node_device_conf.c:3099) +==325982== by 0x505BC4E: virNodeDeviceUpdateCaps (node_device_conf.c:2677) +==325982== by 0x260FCBB2: nodeDeviceGetXMLDesc (node_device_driver.c:355) + +Signed-off-by: Tim Shearer +Reviewed-by: Ján Tomko +Signed-off-by: Han Han +--- + src/util/virpci.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/util/virpci.c b/src/util/virpci.c +index 9e564e4a4f..cc2b07bbba 100644 +--- a/src/util/virpci.c ++++ b/src/util/virpci.c +@@ -2245,6 +2245,7 @@ virPCIVirtualFunctionListFree(virPCIVirtualFunctionList *list) + g_free(list->functions[i].ifname); + } + ++ g_free(list->functions); + g_free(list); + } + +-- +2.41.0 + diff --git a/libvirt.spec b/libvirt.spec index a63524b..0cda2c8 100644 --- a/libvirt.spec +++ b/libvirt.spec @@ -229,7 +229,7 @@ Summary: Library providing a simple virtualization API Name: libvirt Version: 9.0.0 -Release: 3%{?dist} +Release: 4%{?dist} License: LGPLv2+ URL: https://libvirt.org/ @@ -243,6 +243,9 @@ Patch0001: 0001-qemuProcessRefreshDisks-Don-t-skip-filling-of-disk-i.patch # Fix curl API deprecation error Patch0002: 0002-ch-use-CURLOPT_UPLOAD-instead-of-CURLOPT_PUT.patch +Patch0003: 0003-storage-Fix-returning-of-locked-objects-from-virStor.patch +Patch0004: 0004-virpci-Resolve-leak-in-virPCIVirtualFunctionList-cle.patch + Requires: libvirt-daemon = %{version}-%{release} Requires: libvirt-daemon-config-network = %{version}-%{release} Requires: libvirt-daemon-config-nwfilter = %{version}-%{release} @@ -2315,6 +2318,9 @@ exit 0 %changelog +* Thu Jan 25 2024 Daniel P. Berrangé - 9.0.0-4 +- Fix CVE-2023-3750 and CVE-2023-2700 + * Sun May 07 2023 Cole Robinson - 9.0.0-3 - Fix 'Tray of device is not open' error when changing CDROM (bz #2163117) - Fix curl API deprecation error