Skip to contentSkip to conversation

audit: don't WARN_ON_ONCE(!current->mm) in audit_exe_compare()

PATCH New Paul Moore 1 participant 1 message Nov 15, 2023 Audit

lore
Share & tools
lore

Paul Moore

author maintainer
#0 lore raw

PATCH 1/1 audit: don't WARN_ON_ONCE(!current->mm) in audit_exe_compare()

eBPF can end up calling into the audit code from some odd places, and some of these places don't have @current set properly so we end up tripping the WARN_ON_ONCE(!current->mm) near the top of audit_exe_compare(). While the basic !current->mm check is good, the WARN_ON_ONCE() results in some scary console messages so let's drop that and just do the regular !current->mm check to avoid problems.

Fixes 47846d51348d ("audit: don't take task_lock() in audit_exe_compare() code path")
---
 kernel/audit_watch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/audit_watch.c +1 -1
index 91e82e34b51e..7a98cd176a12 100644
@@ -531,7 +531,7 @@ int audit_exe_compare(struct task_struct *tsk, struct audit_fsnotify_mark *mark)
 	if (tsk != current)
 		return 0;
 
-	if (WARN_ON_ONCE(!current->mm))
+	if (!current->mm)
 		return 0;
 	exe_file = get_mm_exe_file(current->mm);
 	if (!exe_file)
Signature · 1 line
2.42.1