]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerSasha Levin <alexander.levin@microsoft.com>
Wed, 17 Jan 2018 17:55:30 +0000 (12:55 -0500)
commit0740244eaa5a8fd33f61c23d8ecc04907defa25e
treefb180c5bd875a3d7a2be22866baa6295affb7023
parent1a7dc738e4e0bcdb386090e94f168b9db6274a4d
audit: ensure that 'audit=1' actually enables audit for PID 1

[ Upstream commit 173743dd99a49c956b124a74c8aacb0384739a4c ]

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>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
kernel/audit.c