]> asedeno.scripts.mit.edu Git - linux.git/commit
audit: ensure that 'audit=1' actually enables audit for PID 1
authorPaul Moore <paul@paul-moore.com>
Fri, 1 Sep 2017 13:44:34 +0000 (09:44 -0400)
committerPaul Moore <paul@paul-moore.com>
Fri, 10 Nov 2017 21:07:39 +0000 (16:07 -0500)
commit173743dd99a49c956b124a74c8aacb0384739a4c
tree1fccaffd2856fb56366dc02b7a943f86c04991cf
parent196a5085592c62ffa4eb739d7ce49c040c2953a1
audit: ensure that 'audit=1' actually enables audit for PID 1

Prior to this patch we enabled audit in audit_init(), which is too
late for PID 1 as the standard initcalls are run after the PID 1 task
is forked.  This means that we never allocate an audit_context (see
audit_alloc()) for PID 1 and therefore miss a lot of audit events
generated by PID 1.

This patch enables audit as early as possible to help ensure that when
PID 1 is forked it can allocate an audit_context if required.

Reviewed-by: Richard Guy Briggs <rgb@redhat.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
kernel/audit.c