Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:15.5:Update
libvirt.33033
6425a311-virpci-Resolve-leak-in-virPCIVirtualFu...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 6425a311-virpci-Resolve-leak-in-virPCIVirtualFunctionList.patch of Package libvirt.33033
From 79e730b0fb0d47a69cb65374148025f7c98406bd Mon Sep 17 00:00:00 2001 From: Tim Shearer <TShearer@adva.com> 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 <tshearer@adva.com> Reviewed-by: Ján Tomko <jtomko@redhat.com> (cherry picked from commit 6425a311b8ad19d6f9c0b315bf1d722551ea3585) --- src/util/virpci.c | 1 + 1 file changed, 1 insertion(+) Index: libvirt-8.0.0/src/util/virpci.c =================================================================== --- libvirt-8.0.0.orig/src/util/virpci.c +++ libvirt-8.0.0/src/util/virpci.c @@ -2255,6 +2255,7 @@ virPCIVirtualFunctionListFree(virPCIVirt g_free(list->functions[i].ifname); } + g_free(list->functions); g_free(list); }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor