From e924b18021bcb8e1666f31259f3a59d976617835 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Mar 17 2020 12:35:20 +0000 Subject: import libvirt-4.5.0-23.el7_7.6 --- diff --git a/SOURCES/libvirt-node_device_conf-Don-t-leak-physical_function-in-virNodeDeviceGetPCISRIOVCaps.patch b/SOURCES/libvirt-node_device_conf-Don-t-leak-physical_function-in-virNodeDeviceGetPCISRIOVCaps.patch new file mode 100644 index 0000000..f6c26a4 --- /dev/null +++ b/SOURCES/libvirt-node_device_conf-Don-t-leak-physical_function-in-virNodeDeviceGetPCISRIOVCaps.patch @@ -0,0 +1,44 @@ +From 8274ae3935c8ce7386320a76ac4f665372fad417 Mon Sep 17 00:00:00 2001 +Message-Id: <8274ae3935c8ce7386320a76ac4f665372fad417@dist-git> +From: Jiang Kun +Date: Mon, 20 Jan 2020 08:51:25 +0100 +Subject: [PATCH] node_device_conf: Don't leak @physical_function in + virNodeDeviceGetPCISRIOVCaps +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The pci_dev->physical_function is rewritten in +virPCIGetPhysicalFunction() to a newly allocated pointer. +Therefore, we must free the old one to avoid memleak. + +Signed-off-by: Jiang kun +Reviewed-by: Michal Privoznik +(cherry picked from commit 38816336a5026623d0a49988c6681b1323c79f09) + +https://bugzilla.redhat.com/show_bug.cgi?id=1792831 +https://bugzilla.redhat.com/show_bug.cgi?id=1793575 +https://bugzilla.redhat.com/show_bug.cgi?id=1793576 + +Signed-off-by: Ján Tomko +Message-Id: +Reviewed-by: Andrea Bolognani +--- + src/conf/node_device_conf.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c +index fd8f4e4a94..7f5afee41e 100644 +--- a/src/conf/node_device_conf.c ++++ b/src/conf/node_device_conf.c +@@ -2689,6 +2689,7 @@ virNodeDeviceGetPCISRIOVCaps(const char *sysfsPath, + for (i = 0; i < pci_dev->num_virtual_functions; i++) + VIR_FREE(pci_dev->virtual_functions[i]); + VIR_FREE(pci_dev->virtual_functions); ++ VIR_FREE(pci_dev->physical_function); + pci_dev->num_virtual_functions = 0; + pci_dev->max_virtual_functions = 0; + pci_dev->flags &= ~VIR_NODE_DEV_CAP_FLAG_PCI_VIRTUAL_FUNCTION; +-- +2.25.0 + diff --git a/SPECS/libvirt.spec b/SPECS/libvirt.spec index bde7126..039b197 100644 --- a/SPECS/libvirt.spec +++ b/SPECS/libvirt.spec @@ -253,7 +253,7 @@ Summary: Library providing a simple virtualization API Name: libvirt Version: 4.5.0 -Release: 23%{?dist}.5%{?extra_release} +Release: 23%{?dist}.6%{?extra_release} License: LGPLv2+ URL: https://libvirt.org/ @@ -600,6 +600,7 @@ Patch334: libvirt-domain_conf-Make-virDomainDeviceFindSCSIController-accept-virD Patch335: libvirt-domain_conf-Relax-SCSI-addr-used-check.patch Patch336: libvirt-qemu-Forcibly-mknod-even-if-it-exists.patch Patch337: libvirt-RHEL-qemu-Enable-virt-ssbd-for-host-model-with-old-QEMU.patch +Patch338: libvirt-node_device_conf-Don-t-leak-physical_function-in-virNodeDeviceGetPCISRIOVCaps.patch Requires: libvirt-daemon = %{version}-%{release} Requires: libvirt-daemon-config-network = %{version}-%{release} @@ -2502,6 +2503,9 @@ exit 0 %changelog +* Wed Jan 29 2020 Jiri Denemark - 4.5.0-23.el7_7.6 +- node_device_conf: Don't leak @physical_function in virNodeDeviceGetPCISRIOVCaps (rhbz#1793576) + * Mon Jan 13 2020 Jiri Denemark - 4.5.0-23.el7_7.5 - RHEL: qemu: Enable virt-ssbd for host-model with old QEMU (rhbz#1787556)