Skip to content

Commit

Permalink
audit: make ANOM_LINK obey audit_enabled and audit_dummy_context
Browse files Browse the repository at this point in the history
Audit link denied events emit disjointed records when audit is disabled.
No records should be emitted when audit is disabled.

See: linux-audit/audit-kernel#21

Signed-off-by: Richard Guy Briggs <[email protected]>
Signed-off-by: Paul Moore <[email protected]>
  • Loading branch information
rgbriggs authored and pcmoore committed Mar 9, 2018
1 parent 11dd266 commit 15564ff
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions kernel/audit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 15564ff

Please sign in to comment.