Skip to content

Commit

Permalink
audit: don't WARN_ON_ONCE(!current->mm) in audit_exe_compare()
Browse files Browse the repository at this point in the history
commit 969d90e upstream.

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.

Cc: <[email protected]>
Fixes: 47846d5 ("audit: don't take task_lock() in audit_exe_compare() code path")
Reported-by: Artem Savkov <[email protected]>
Signed-off-by: Paul Moore <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
pcmoore authored and gregkh committed Nov 28, 2023
1 parent e29c095 commit 92e6c0f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/audit_watch.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 92e6c0f

Please sign in to comment.