Initialize SELinux and Apparmor after capabilities are set
authorLaurent Bigonville <bigon@bigon.be>
Tue, 17 Nov 2015 20:47:05 +0000 (21:47 +0100)
committerSimon McVittie <smcv@debian.org>
Tue, 1 Dec 2015 22:02:10 +0000 (22:02 +0000)
commita3a5935a0a038c3b44c61ce5719f0f7e647b96c6
tree6ec7dbbcefa2ade519bc8eade60af4a5d96ffc5b
parent1fcb37d0a320967636056be319393764675e77ef
Initialize SELinux and Apparmor after capabilities are set

avc_init() in the SELinux code path is creating a new thread, we need to
set to capabilities before it gets created so it has the permission to
send audit messages.

It also make more sense to open the audit netlink before the different
logging callbacks are set.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92832
[smcv: add comments explaining why initialization must happen in this
specific order]
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
bus/bus.c