libvirt-8.0.0-3.el9

- qemuDomainSetupDisk: Initialize 'targetPaths' (rhbz#2046170)

Resolves: rhbz#2046170
This commit is contained in:
Jiri Denemark 2022-02-02 09:50:20 +01:00
parent 782b405d19
commit 1670f0c193
2 changed files with 46 additions and 1 deletions

View File

@ -0,0 +1,41 @@
From 0eec7bae9f59b2693798d25d346243109e92aeff Mon Sep 17 00:00:00 2001
Message-Id: <0eec7bae9f59b2693798d25d346243109e92aeff@dist-git>
From: Peter Krempa <pkrempa@redhat.com>
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 <pkrempa@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
(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

View File

@ -228,7 +228,7 @@
Summary: Library providing a simple virtualization API Summary: Library providing a simple virtualization API
Name: libvirt Name: libvirt
Version: 8.0.0 Version: 8.0.0
Release: 2%{?dist}%{?extra_release} Release: 3%{?dist}%{?extra_release}
License: LGPLv2+ License: LGPLv2+
URL: https://libvirt.org/ URL: https://libvirt.org/
@ -244,6 +244,7 @@ Patch3: libvirt-docs-Add-man-page-for-libvirt-guests.patch
Patch4: libvirt-remove-sysconfig-files.patch Patch4: libvirt-remove-sysconfig-files.patch
Patch5: libvirt-qemu-fix-inactive-snapshot-revert.patch Patch5: libvirt-qemu-fix-inactive-snapshot-revert.patch
Patch6: libvirt-Revert-report-error-when-virProcessGetStatInfo-is-unable-to-parse-data.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 = %{version}-%{release}
Requires: libvirt-daemon-config-network = %{version}-%{release} Requires: libvirt-daemon-config-network = %{version}-%{release}
@ -2135,6 +2136,9 @@ exit 0
%changelog %changelog
* Wed Feb 2 2022 Jiri Denemark <jdenemar@redhat.com> - 8.0.0-3
- qemuDomainSetupDisk: Initialize 'targetPaths' (rhbz#2046170)
* Tue Jan 25 2022 Jiri Denemark <jdenemar@redhat.com> - 8.0.0-2 * Tue Jan 25 2022 Jiri Denemark <jdenemar@redhat.com> - 8.0.0-2
- build: Only install libvirt-guests when building libvirtd (rhbz#2042529) - build: Only install libvirt-guests when building libvirtd (rhbz#2042529)
- docs: Add man page for libvirt-guests (rhbz#2042529) - docs: Add man page for libvirt-guests (rhbz#2042529)