]> git.ipfire.org Git - thirdparty/libvirt.git/commit
security: Try harder to run transactions
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 18 Mar 2020 09:18:46 +0000 (10:18 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 20 Mar 2020 15:43:13 +0000 (16:43 +0100)
commitea903036fa8d2333edb74b617416416dd75be533
treea052612dd473324859a98b1c49aa5b79ed6bbb09
parentc799d150d5e9daec8f970f1be94966683963fda2
security: Try harder to run transactions

When a QEMU process dies in the middle of a hotplug, then we fail
to restore the seclabels on the device. The problem is that if
the thread doing hotplug locks the domain object first and thus
blocks the thread that wants to do qemuProcessStop(), the
seclabel cleanup code will see vm->pid still set and mount
namespace used and therefore try to enter the namespace
represented by the PID. But the PID is gone really and thus
entering will fail and no restore is done. What we can do is to
try enter the namespace (if requested to do so) but if entering
fails, fall back to no NS mode.

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

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Pavel Mores <pmores@redhat.com>
src/security/security_dac.c
src/security/security_selinux.c