audit: don't WARN_ON_ONCE(!current->mm) in audit_exe_compare()
authorPaul Moore <paul@paul-moore.com>
Tue, 14 Nov 2023 22:25:48 +0000 (17:25 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 28 Nov 2023 17:07:08 +0000 (17:07 +0000)
commitd91fd028c9f6acfec3094c0989a59c29c87d3b71
tree8284a8da05001bce408ae6c261fecdc1254557fb
parent38968c63e98e5abaac93c4e6f9a602310f612630
audit: don't WARN_ON_ONCE(!current->mm) in audit_exe_compare()

commit 969d90ec212bae4b45bf9d21d7daa30aa6cf055e 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: <stable@vger.kernel.org>
Fixes: 47846d51348d ("audit: don't take task_lock() in audit_exe_compare() code path")
Reported-by: Artem Savkov <asavkov@redhat.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/audit_watch.c