mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-10 07:00:48 +00:00
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>
This commit is contained in:
parent
11dd266637
commit
15564ff0a1
@ -2315,6 +2315,9 @@ void audit_log_link_denied(const char *operation, const struct path *link)
|
|||||||
struct audit_buffer *ab;
|
struct audit_buffer *ab;
|
||||||
struct audit_names *name;
|
struct audit_names *name;
|
||||||
|
|
||||||
|
if (!audit_enabled || audit_dummy_context())
|
||||||
|
return;
|
||||||
|
|
||||||
name = kzalloc(sizeof(*name), GFP_NOFS);
|
name = kzalloc(sizeof(*name), GFP_NOFS);
|
||||||
if (!name)
|
if (!name)
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user