]> git.ipfire.org Git - thirdparty/libvirt.git/commit
sec_manager: Refuse to start domain with unsupported seclabel
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 2 Apr 2013 15:49:34 +0000 (17:49 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 3 Apr 2013 08:19:46 +0000 (10:19 +0200)
commit8d68cbeaa8a64759323da1d64526e2a941eb93e1
tree2a67b8d63b04b30b029e2a2b882d5def628c5cef
parente7cd2844ca2b0d716a520667eff286713963e2ec
sec_manager: Refuse to start domain with unsupported seclabel

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

If a user configures a domain to use a seclabel of a specific type,
but the appropriate driver is not accessible, we should refuse to
start the domain. For instance, if user requires selinux, but it is
either non present in the system, or is just disabled, we should not
start the domain. Moreover, since we are touching only those labels we
have a security driver for, the other labels may confuse libvirt when
reconnecting to a domain on libvirtd restart. In our selinux example,
when starting up a domain, missing security label is okay, as we
auto-generate one. But later, when libvirt is re-connecting to a live
qemu instance, we parse a state XML, where security label is required
and it is an error if missing:

  error : virSecurityLabelDefParseXML:3228 : XML error: security label
  is missing

This results in a qemu process left behind without any libvirt control.
src/security/security_manager.c