[PATCH] qemu: perf: Fix crash/memory corruption on failed VM start

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The new perf code didn't bother to clear a pointer in 'priv' causing a
double free or other memory corruption goodness if a VM failed to start.

Clear the pointer after freeing the memory.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1324757
---
 src/qemu/qemu_process.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 2b600c1..6c870f5 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -3444,6 +3444,7 @@ qemuDomainPerfRestart(virDomainObjPtr vm)

  cleanup:
     virPerfFree(priv->perf);
+    priv->perf = NULL;
     return -1;
 }

@@ -5970,6 +5971,7 @@ void qemuProcessStop(virQEMUDriverPtr driver,
     virCgroupFree(&priv->cgroup);

     virPerfFree(priv->perf);
+    priv->perf = NULL;

     qemuProcessRemoveDomainStatus(driver, vm);

-- 
2.8.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]