]> git.ipfire.org Git - thirdparty/libvirt.git/commit
network: Don't crash on domain destroy
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 22 Mar 2017 12:07:14 +0000 (13:07 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 29 Mar 2017 07:29:35 +0000 (09:29 +0200)
commit2fe93123bfb6e3bc373b3cc70c60522235c9c931
tree694cc314d6c121d87519168400c74774e6240e3b
parentd63d54e558247fb5faf03d5613a8c406a3646d03
network: Don't crash on domain destroy

https://bugzilla.redhat.com/show_bug.cgi?id=1434882

Imagine the following scenario:

1) virsh net-start default
2) virsh start myFavouriteDomain
3) virsh net-destroy default
4) virsh destroy myFavouriteDomain

(assuming myFavouriteDomain has an interface from default
network)

Regardless of how unlikely this scenario looks like, we should
not crash. The problem is, on net-destroy in
networkShutdownNetworkVirtual() the virMacMap module is unrefed,
but the stale pointer is kept around. Thus when the domain
destroy procedure comes in, networkReleaseActualDevice() and
subsequently networkMacMgrDel() is called. This function sees the
stale pointer and starts calling the virMacMap module APIs which
work over freed memory.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
src/network/bridge_driver.c