From: Denis Rastyogin <gerben(a)altlinux.org>
virGetLastError() may return NULL in case of OOM. Without a check this
could lead to a NULL pointer dereference when accessing its fields.
The result of virGetLastError() is usually checked in other places, so
add the missing check here as well.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Reported-by: Pavel Nekrasov <p.nekrasov(a)fobos-nt.ru>
Signed-off-by: Denis Rastyogin <gerben(a)altlinux.org>
---
tools/virt-login-shell-helper.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tools/virt-login-shell-helper.c b/tools/virt-login-shell-helper.c
index cb59b5dec0..9282ca481e 100644
--- a/tools/virt-login-shell-helper.c
+++ b/tools/virt-login-shell-helper.c
@@ -282,6 +282,10 @@ main(int argc, char **argv)
if (!virDomainIsActive(dom) && virDomainCreate(dom) < 0) {
virErrorPtr last_error;
last_error = virGetLastError();
+
+ if (!last_error)
+ goto cleanup;
+
if (last_error->code != VIR_ERR_OPERATION_INVALID) {
virReportSystemError(last_error->code,
_("Can't create %1$s container: %2$s"),
--
2.42.2
The 11.8.0 release of both libvirt and libvirt-python is tagged and
signed tarballs are available at
https://download.libvirt.org/https://download.libvirt.org/python/
Thanks everybody who helped with this release by sending patches,
reviewing, testing, or providing feedback. Your work is greatly
appreciated.
* New features
* ch: Disk hotplug Support
Users can now attach and detach disks of Cloud Hypervisor domains at
runtime.
* qemu: Add support for NUMA affinity of PCI devices
To support NVIDIA Multi-Instance GPU (MIG) configurations, libvirt now
handles QEMU's acpi-generic-initiator device internally. MIG enables
partitioning a physical GPU into multiple isolated instances, each
associated with one or more virtual NUMA nodes.
On the XML side, the existing ``<acpi>`` element has been extended with a
``nodeset`` attribute to specify the NUMA node affinity of a PCI device.
* Improvements
* ch: Events emitting
The CH driver not only emits more domain lifecycle events but also
implements ``virConnectDomainEventRegister()`` and
``virConnectDomainEventDeregister()`` APIs for management applications to
listen on those events.
* Bug fixes
* qemu: Fix selection of stateless/combined firmware
A stateless firmware will now be correctly chosen when appropriate,
e.g. for domains configured to use SEV-SNP.
* ch: Make sure the cloud-hypervisor process is killed in ``virCHProcessStop()``
Due to wrong assumptions in the CH driver, calling ``virDomainDestroy()``
did not kill the corresponding cloud-hypervisor process. Domains can be now
destroyed reliably.
Enjoy.
Jirka