From 1670f0c193afa55c5530780d6c5fb8843f2a1b1f Mon Sep 17 00:00:00 2001 From: Jiri Denemark Date: Wed, 2 Feb 2022 09:50:20 +0100 Subject: [PATCH] libvirt-8.0.0-3.el9 - qemuDomainSetupDisk: Initialize 'targetPaths' (rhbz#2046170) Resolves: rhbz#2046170 --- ...mainSetupDisk-Initialize-targetPaths.patch | 41 +++++++++++++++++++ libvirt.spec | 6 ++- 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 libvirt-qemuDomainSetupDisk-Initialize-targetPaths.patch diff --git a/libvirt-qemuDomainSetupDisk-Initialize-targetPaths.patch b/libvirt-qemuDomainSetupDisk-Initialize-targetPaths.patch new file mode 100644 index 0000000..cdec8db --- /dev/null +++ b/libvirt-qemuDomainSetupDisk-Initialize-targetPaths.patch @@ -0,0 +1,41 @@ +From 0eec7bae9f59b2693798d25d346243109e92aeff Mon Sep 17 00:00:00 2001 +Message-Id: <0eec7bae9f59b2693798d25d346243109e92aeff@dist-git> +From: Peter Krempa +Date: Tue, 25 Jan 2022 17:49:00 +0100 +Subject: [PATCH] qemuDomainSetupDisk: Initialize 'targetPaths' + +Compiler isn't able to see that 'virDevMapperGetTargets' in cases e.g. +when the devmapper isn't available may not initialize the value in the +pointer passed as the second argument. + +The usage 'qemuDomainSetupDisk' lead to an accidental infinite loop as +previous calls apparently doctored the stack to a point where +'g_slist_concat' would end up in an infinite loop trying to find the end +of the list. + +Fixes: 6c49c2ee9fcb88de02cdc333f666a8e95d60a3b0 +Closes: https://gitlab.com/libvirt/libvirt/-/issues/268 +Signed-off-by: Peter Krempa +Reviewed-by: Andrea Bolognani +(cherry picked from commit ddb2384f0c78a91c40d95afdbc7fe325e95ef2bc) +https://bugzilla.redhat.com/show_bug.cgi?id=2046170 +--- + src/qemu/qemu_namespace.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/qemu/qemu_namespace.c b/src/qemu/qemu_namespace.c +index 23b1160c5e..94453033f5 100644 +--- a/src/qemu/qemu_namespace.c ++++ b/src/qemu/qemu_namespace.c +@@ -251,7 +251,7 @@ qemuDomainSetupDisk(virStorageSource *src, + if (!(tmpPath = virPCIDeviceAddressGetIOMMUGroupDev(&next->nvme->pciAddr))) + return -1; + } else { +- GSList *targetPaths; ++ GSList *targetPaths = NULL; + + if (virStorageSourceIsEmpty(next) || + !virStorageSourceIsLocalStorage(next)) { +-- +2.35.1 + diff --git a/libvirt.spec b/libvirt.spec index 4f3e119..e6b3a6d 100644 --- a/libvirt.spec +++ b/libvirt.spec @@ -228,7 +228,7 @@ Summary: Library providing a simple virtualization API Name: libvirt Version: 8.0.0 -Release: 2%{?dist}%{?extra_release} +Release: 3%{?dist}%{?extra_release} License: LGPLv2+ URL: https://libvirt.org/ @@ -244,6 +244,7 @@ Patch3: libvirt-docs-Add-man-page-for-libvirt-guests.patch Patch4: libvirt-remove-sysconfig-files.patch Patch5: libvirt-qemu-fix-inactive-snapshot-revert.patch Patch6: libvirt-Revert-report-error-when-virProcessGetStatInfo-is-unable-to-parse-data.patch +Patch7: libvirt-qemuDomainSetupDisk-Initialize-targetPaths.patch Requires: libvirt-daemon = %{version}-%{release} Requires: libvirt-daemon-config-network = %{version}-%{release} @@ -2135,6 +2136,9 @@ exit 0 %changelog +* Wed Feb 2 2022 Jiri Denemark - 8.0.0-3 +- qemuDomainSetupDisk: Initialize 'targetPaths' (rhbz#2046170) + * Tue Jan 25 2022 Jiri Denemark - 8.0.0-2 - build: Only install libvirt-guests when building libvirtd (rhbz#2042529) - docs: Add man page for libvirt-guests (rhbz#2042529)