]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Fix potential crash when saving guests
authorDaniel P. Berrange <berrange@redhat.com>
Thu, 30 Jun 2011 14:05:59 +0000 (15:05 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Thu, 30 Jun 2011 17:04:02 +0000 (18:04 +0100)
commite44bec2e344139bc5efafb6a8c820cf8ef3740bd
tree18c08986b75d6a958d7b2e9c050b9b4edf760e42
parentf870c99b4583db0e74b33c9334f195f4feed304b
Fix potential crash when saving guests

The qemudDomainSaveFlag method will call EndJob on the 'vm'
object it is passed in. This can result in the 'vm' object
being free'd if the last reference is removed. Thus no caller
of 'qemudDomainSaveFlag' must *ever* reference 'vm' again
upon return.

Unfortunately qemudDomainSave and qemuDomainManagedSave
both call 'virDomainObjUnlock', which can result in a
crash. This is non-deterministic since it involves a race
with the monitor I/O thread.

Fix this by making qemudDomainSaveFlag responsible for
calling virDomainObjUnlock instead.

* src/qemu/qemu_driver.c: Fix potential use after free
  when saving guests
src/qemu/qemu_driver.c