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>
Wed, 22 Mar 2017 09:32:34 +0000 (09:32 +0000)
commit4af0c1f26e415a3f46b85956e7e1aee3f714de04
tree13f331b2d08a47505116703a440bbc7f0df059a5
parentfea69f0661ff48382218874f6598849a9e71ea31
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>
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=857660
Reviewed-by: Stephen Smalley <sds@tycho.nsa.gov>
(cherry picked from commit a3a5935a0a038c3b44c61ce5719f0f7e647b96c6)
bus/bus.c