]> git.ipfire.org Git - thirdparty/libvirt.git/commit
storage: fix device detach regression with cgroup ACLs
authorEric Blake <eblake@redhat.com>
Tue, 27 Nov 2012 13:55:00 +0000 (06:55 -0700)
committerEric Blake <eblake@redhat.com>
Tue, 27 Nov 2012 15:02:26 +0000 (08:02 -0700)
commit1b2ebf950289de6b112e1e279df11030cb1d7ba2
tree0eaff89f0bb2af023c07671301172ef0e539e5d5
parentf97a569944df04a7cd06ce98c61c31e1337fe99d
storage: fix device detach regression with cgroup ACLs

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

Commit 38c4a9cc introduced a regression in hot unplugging of disks
from qemu, where cgroup device ACLs were no longer being revoked
(thankfully not a security hole: cgroup ACLs only prevent open()
of the disk; so reverting the ACL prevents future abuse but doesn't
stop abuse from an fd that was already opened before the ACL change).

The actual regression is due to a latent bug.  The hot unplug code
was computing the set of files needing cgroup ACL revocation based
on the XML passed in by the user, rather than based on the domain's
details on which disk was being deleted.  As long as the revoke
path was always recomputing the backing chain, this didn't really
matter; but now that we want to compute the chain exactly once and
remember that computation, we need to hang on to the backing chain
until after the revoke has happened.

* src/qemu/qemu_hotplug.c (qemuDomainDetachPciDiskDevice):
Transfer backing chain before deletion.
src/qemu/qemu_hotplug.c