diff options
author | Richard Guy Briggs | 2018-02-14 11:18:21 -0500 |
---|---|---|
committer | Paul Moore | 2018-03-08 19:19:54 -0500 |
commit | 15564ff0a16e2d994e78d62c23d227ff182ee864 (patch) | |
tree | 6615f771b9bc495bcc2c045291ba7df0ec782734 /kernel/audit.c | |
parent | 11dd2666375e191757dd4271d5020820c6d0e4a5 (diff) |
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.c | 3 |
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; |