diff options
author | Richard Guy Briggs <rgb@redhat.com> | 2018-02-14 17:18:21 +0100 |
---|---|---|
committer | Paul Moore <paul@paul-moore.com> | 2018-03-09 01:19:54 +0100 |
commit | 15564ff0a16e2d994e78d62c23d227ff182ee864 (patch) | |
tree | 6615f771b9bc495bcc2c045291ba7df0ec782734 /kernel/audit.c | |
parent | audit: do not panic on invalid boot parameter (diff) | |
download | linux-15564ff0a16e2d994e78d62c23d227ff182ee864.tar.xz linux-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.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; |