1
0
Fork 0

audit: check audit_enabled in audit_tree_log_remove_rule()

Respect the audit_enabled flag when printing tree rule config change
records.

See: https://github.com/linux-audit/audit-kernel/issues/50

Signed-off-by: Richard Guy Briggs <rgb@redhat.com>
[PM: tweak the subject line]
Signed-off-by: Paul Moore <paul@paul-moore.com>
hifive-unleashed-5.1
Richard Guy Briggs 2018-06-14 16:20:05 -04:00 committed by Paul Moore
parent 4b09791ba0
commit 65a8766f5f
1 changed files with 2 additions and 0 deletions

View File

@ -497,6 +497,8 @@ static void audit_tree_log_remove_rule(struct audit_krule *rule)
{
struct audit_buffer *ab;
if (!audit_enabled)
return;
ab = audit_log_start(NULL, GFP_KERNEL, AUDIT_CONFIG_CHANGE);
if (unlikely(!ab))
return;