Commit fe8847f7 authored by Paul Moore's avatar Paul Moore Committed by Yongqiang Liu
Browse files

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

stable inclusion
from stable-v4.19.300
commit b05c285bc52a98596ad062b36785b353c0438799
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I8UH13


CVE: NA

--------------------------------

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: default avatarArtem Savkov <asavkov@redhat.com>
Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarYongqiang Liu <liuyongqiang13@huawei.com>
parent 19c82a7a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -561,7 +561,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)