[PW_SID:1158543] entry: Guard syscall_enter_audit() invocation with CONFIG_AUDITSYSCALL - #2596
[PW_SID:1158543] entry: Guard syscall_enter_audit() invocation with CONFIG_AUDITSYSCALL#2596linux-riscv-bot wants to merge 1 commit into
Conversation
A bunch of older cross compilers notably RISCV64 and S390 fail to eliminate
the dead code when CONFIG_AUDITSYSCALL=n. The code in question is:
if (unlikely(audit_context())
syscall_enter_audit(regs);
and in case of CONFIG_AUDITSYSCALL=n:
static inline struct audit_context *audit_context(void)
{
return NULL;
}
which should make the compiler eliminate the syscall_enter_audit()
call. But a RISV64 GCC12 cross compiler translates that into:
if (unlikely(audit_context()))
1c34: 00000097 auipc ra,0x0
1c38: 000080e7 jalr ra # 1c34 <.L785>
1c3c: c511 beqz a0,1c48 <.L787>
syscall_enter_audit(regs);
1c3e: 8526 mv a0,s1
1c40: 00000097 auipc ra,0x0
1c44: 000080e7 jalr ra # 1c40 <.L785+0xc>
and then claims in the failing link:
include/asm-generic/preempt.h:54:(.noinstr.text+0x1a20):
undefined reference to 'syscall_enter_audit'
which is obviously hallucination.
Add an explicit IS_ENABLED(CONFIG_AUDITSYSCALL) check into the condition to
cure this compiler madness.
Fixes: 6f25517 ("entry: Rework syscall_audit_enter()")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Cc: stable@vger.kernel.org
Closes: https://lore.kernel.org/oe-kbuild-all/202609031938.ZvZZaRQy-lkp@intel.com/
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
|
Patch 1: "entry: Guard syscall_enter_audit() invocation with CONFIG_AUDITSYSCALL" |
|
Patch 1: "entry: Guard syscall_enter_audit() invocation with CONFIG_AUDITSYSCALL" |
|
Patch 1: "entry: Guard syscall_enter_audit() invocation with CONFIG_AUDITSYSCALL" |
|
Patch 1: "entry: Guard syscall_enter_audit() invocation with CONFIG_AUDITSYSCALL" |
|
Patch 1: "entry: Guard syscall_enter_audit() invocation with CONFIG_AUDITSYSCALL" |
|
Patch 1: "entry: Guard syscall_enter_audit() invocation with CONFIG_AUDITSYSCALL" |
|
Patch 1: "entry: Guard syscall_enter_audit() invocation with CONFIG_AUDITSYSCALL" |
|
Patch 1: "entry: Guard syscall_enter_audit() invocation with CONFIG_AUDITSYSCALL" |
|
Patch 1: "entry: Guard syscall_enter_audit() invocation with CONFIG_AUDITSYSCALL" |
|
Patch 1: "entry: Guard syscall_enter_audit() invocation with CONFIG_AUDITSYSCALL" |
|
Patch 1: "entry: Guard syscall_enter_audit() invocation with CONFIG_AUDITSYSCALL" |
|
Patch 1: "entry: Guard syscall_enter_audit() invocation with CONFIG_AUDITSYSCALL" |
PR for series 1158543 applied to workflow__riscv__fixes
Name: entry: Guard syscall_enter_audit() invocation with CONFIG_AUDITSYSCALL
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1158543
Version: 1