]> git.ipfire.org Git - thirdparty/libvirt.git/commit
implement usb and pci hot attach in AppArmor driver
authorJamie Strandboge <jamie@canonical.com>
Thu, 30 Sep 2010 20:54:56 +0000 (14:54 -0600)
committerEric Blake <eblake@redhat.com>
Thu, 30 Sep 2010 20:54:56 +0000 (14:54 -0600)
commit593e0072eb789ac7661078bac9bc2cfd1c3c68df
tree8efd68291bc2e8644acecf05e31b6bf7a60da9c4
parentf095424600c311f2f08da552d20fb2e2d7ff5045
implement usb and pci hot attach in AppArmor driver

Description: Implement AppArmorSetSecurityHostdevLabel() and
AppArmorRestoreSecurityHostdevLabel() for hostdev and pcidev attach.

virt-aa-helper also has to be adjusted because *FileIterate() is used for pci
and usb devices and the corresponding XML for hot attached hostdev and pcidev
is not in the XML passed to virt-aa-helper. The new '-F filename' option is
added to append a rule to the profile as opposed to the existing '-f
filename', which rewrites the libvirt-<uuid>.files file anew. This new '-F'
option will append a rule to an existing libvirt-<uuid>.files if it exists,
otherwise it acts the same as '-f'.

load_profile() and reload_profile() have been adjusted to add an 'append'
argument, which when true will use '-F' instead of '-f' when executing
virt-aa-helper.

All existing calls to load_profile() and reload_profile() have been adjusted
to use the old behavior (ie append==false) except AppArmorSetSavedStateLabel()
where it made sense to use the new behavior.

This patch also adds tests for '-F'.

Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/640993
src/security/security_apparmor.c
src/security/virt-aa-helper.c
tests/virt-aa-helper-test