Skip to content

Commit 654d61b

Browse files
rgbriggspcmoore
authored andcommitted
audit: record AUDIT_ANOM_* events regardless of presence of rules
When no audit rules are in place, AUDIT_ANOM_{LINK,CREAT} events reported in audit_log_path_denied() are unconditionally dropped due to an explicit check for the existence of any audit rules. Given this is a report of a security violation, allow it to be recorded regardless of the existence of any audit rules. To test, mkdir -p /root/tmp chmod 1777 /root/tmp touch /root/tmp/test.txt useradd test chown test /root/tmp/test.txt {echo C0644 12 test.txt; printf 'hello\ntest1\n'; printf \\000;} | \ scp -t /root/tmp Check with ausearch -m ANOM_CREAT -ts recent Link: https://issues.redhat.com/browse/RHEL-9065 Signed-off-by: Richard Guy Briggs <[email protected]> Signed-off-by: Paul Moore <[email protected]>
1 parent baaba7b commit 654d61b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/audit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2285,7 +2285,7 @@ void audit_log_path_denied(int type, const char *operation)
22852285
{
22862286
struct audit_buffer *ab;
22872287

2288-
if (!audit_enabled || audit_dummy_context())
2288+
if (!audit_enabled)
22892289
return;
22902290

22912291
/* Generate log with subject, operation, outcome. */

0 commit comments

Comments
 (0)