]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Move load of AppArmor profile to GenLabel()
authorJamie Strandboge <jamie@canonical.com>
Fri, 24 Jun 2011 14:51:37 +0000 (09:51 -0500)
committerEric Blake <eblake@redhat.com>
Fri, 24 Jun 2011 16:09:44 +0000 (10:09 -0600)
commit0b501bd4e1fd60a5434ead4c3fd054fd369219c4
tree924d1c5c90ee59a57e2883b751530dc573a735d7
parentdb323e3b9787f058856f1d46180462f307634126
Move load of AppArmor profile to GenLabel()

Commit 12317957ecd6c37a2fb16275dcdeeacfe25c517 introduced an incompatible
architectural change for the AppArmor security driver. Specifically,
virSecurityManagerSetAllLabel() is now called much later in
src/qemu/qemu_process.c:qemuProcessStart(). Previously, SetAllLabel() was
called immediately after GenLabel() such that after the dynamic label (profile
name) was generated, SetAllLabel() would be called to create and load the
AppArmor profile into the kernel before qemuProcessHook() was executed. With
12317957ecd6c37a2fb16275dcdeeacfe25c517, qemuProcessHook() is now called
before SetAllLabel(), such that aa_change_profile() ends up being called
before the AppArmor profile is loaded into the kernel (via ProcessLabel() in
qemuProcessHook()).

This patch addresses the change by making GenLabel() load the AppArmor
profile into the kernel after the label (profile name) is generated.
SetAllLabel() is then adjusted to only reload_profile() and append stdin_fn to
the profile when it is specified. This also makes the AppArmor driver work
like its SELinux counterpart with regard to SetAllLabel() and stdin_fn.
Bug-Ubuntu: https://launchpad.net/bugs/801569
src/security/security_apparmor.c