[PATCH] entry: Provide stub for syscall_enter_audit() when auditing is disabled
From: Jinjie Ruan
Date: Mon Jul 20 2026 - 05:56:50 EST
When CONFIG_AUDITSYSCALL is not set, syscall_enter_audit() is not
defined, causing following undefined reference warning. So add an empty
inline stub to resolve the missing symbol.
include/linux/entry-common.h:109:(.noinstr.text+0x2e6): undefined reference to `syscall_enter_audit'
Fixes: ff2b9a905930 ("entry: Rework syscall_audit_enter()")
Signed-off-by: Jinjie Ruan <ruanjinjie@xxxxxxxxxx>
Reported-by: kernel test robot <lkp@xxxxxxxxx>
Closes: https://lore.kernel.org/oe-kbuild-all/202607181530.2nx8zb3J-lkp@xxxxxxxxx/
---
include/linux/entry-common.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/include/linux/entry-common.h b/include/linux/entry-common.h
index 6574b7183c01..016165cffc9f 100644
--- a/include/linux/entry-common.h
+++ b/include/linux/entry-common.h
@@ -60,7 +60,11 @@ static __always_inline bool arch_ptrace_report_syscall_permit_entry(struct pt_re
void trace_syscall_enter(struct pt_regs *regs);
void trace_syscall_exit(struct pt_regs *regs, long ret);
+#ifdef CONFIG_AUDITSYSCALL
void syscall_enter_audit(struct pt_regs *regs);
+#else
+static inline void syscall_enter_audit(struct pt_regs *regs) { }
+#endif
static __always_inline long syscall_trace_enter(struct pt_regs *regs, unsigned long work,
long syscall)
--
2.34.1