aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/audit.c
diff options
context:
space:
mode:
authorRichard Guy Briggs <rgb@redhat.com>2018-02-14 11:18:21 -0500
committerPaul Moore <paul@paul-moore.com>2018-03-08 19:19:54 -0500
commit15564ff0a16e2d994e78d62c23d227ff182ee864 (patch)
tree6615f771b9bc495bcc2c045291ba7df0ec782734 /kernel/audit.c
parentaudit: do not panic on invalid boot parameter (diff)
downloadlinux-dev-15564ff0a16e2d994e78d62c23d227ff182ee864.tar.xz
linux-dev-15564ff0a16e2d994e78d62c23d227ff182ee864.zip
audit: make ANOM_LINK obey audit_enabled and audit_dummy_context
Audit link denied events emit disjointed records when audit is disabled. No records should be emitted when audit is disabled. See: https://github.com/linux-audit/audit-kernel/issues/21 Signed-off-by: Richard Guy Briggs <rgb@redhat.com> Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'kernel/audit.c')
-rw-r--r--kernel/audit.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/audit.c b/kernel/audit.c
index 69ef8de69f03..46cd8f66af17 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -2315,6 +2315,9 @@ void audit_log_link_denied(const char *operation, const struct path *link)
struct audit_buffer *ab;
struct audit_names *name;
+ if (!audit_enabled || audit_dummy_context())
+ return;
+
name = kzalloc(sizeof(*name), GFP_NOFS);
if (!name)
return;