]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
audit: record fanotify event regardless of presence of rules
authorRichard Guy Briggs <rgb@redhat.com>
Wed, 6 Aug 2025 21:04:07 +0000 (17:04 -0400)
committerPaul Moore <paul@paul-moore.com>
Mon, 11 Aug 2025 15:44:58 +0000 (11:44 -0400)
When no audit rules are in place, fanotify event results are
unconditionally dropped due to an explicit check for the existence of
any audit rules.  Given this is a report from another security
sub-system, allow it to be recorded regardless of the existence of any
audit rules.

To test, install and run the fapolicyd daemon with default config.  Then
as an unprivileged user, create and run a very simple binary that should
be denied.  Then check for an event with
ausearch -m FANOTIFY -ts recent

Link: https://issues.redhat.com/browse/RHEL-9065
Signed-off-by: Richard Guy Briggs <rgb@redhat.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
include/linux/audit.h

index a394614ccd0b81e199dbe1d9ad81de4d766ad3b3..e3f06eba9c6e6e582eabd494cbaa1b6863a2df47 100644 (file)
@@ -527,7 +527,7 @@ static inline void audit_log_kern_module(const char *name)
 
 static inline void audit_fanotify(u32 response, struct fanotify_response_info_audit_rule *friar)
 {
-       if (!audit_dummy_context())
+       if (audit_enabled)
                __audit_fanotify(response, friar);
 }