]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: Remove hostdev entry when freeing the depending network entry
authorPeter Krempa <pkrempa@redhat.com>
Tue, 27 Aug 2013 17:06:18 +0000 (19:06 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 29 Aug 2013 08:41:45 +0000 (10:41 +0200)
commit50348e6edfa10ddb61929bf95a1c4820a9614e19
tree2ee0191298f01f1142964b465e5b805a2b8a0b46
parent8aecd351266a66efa59b7f7be77bf66693d99ce0
qemu: Remove hostdev entry when freeing the depending network entry

When using a <interface type="network"> that points to a network with
hostdev forwarding mode a hostdev alias is created for the network. This
allias is inserted into the hostdev list, but is backed with a part of
the network object that it is connected to.

When a VM is being stopped qemuProcessStop() calls
networkReleaseActualDevice() which eventually frees the memory for the
hostdev object. Afterwards when the domain definition is being freed by
virDomainDefFree() an invalid pointer is accessed by
virDomainHostdevDefFree() and may cause a crash of the daemon.

This patch removes the entry in the hostdev list before freeing the
depending memory to avoid this issue.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1000973
src/conf/domain_conf.c
src/conf/domain_conf.h
src/libvirt_private.syms
src/qemu/qemu_hotplug.c
src/qemu/qemu_process.c