From: Thomas Gleixner <tglx@kernel.org>
To: Jinjie Ruan <ruanjinjie@huawei.com>,
peterz@infradead.org, luto@kernel.org,
linux-kernel@vger.kernel.org
Cc: kernel test robot <lkp@intel.com>,
oe-kbuild-all@lists.linux.dev,
Sven Schnelle <svens@linux.ibm.com>
Subject: Re: [PATCH] entry: Provide stub for syscall_enter_audit() when auditing is disabled
Date: Mon, 20 Jul 2026 17:34:01 +0200 [thread overview]
Message-ID: <87cxwhn09i.ffs@fw13> (raw)
In-Reply-To: <20260720094921.537716-1-ruanjinjie@huawei.com>
On Mon, Jul 20 2026 at 17:49, Jinjie Ruan wrote:
> 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@huawei.com>
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202607181530.2nx8zb3J-lkp@intel.com/
This does not make any sense at all.
The call site is:
if (audit_context())
syscall_enter_audit(....);
audit.h has:
#ifdef CONFIG_AUDITSYSCALL
...
#else
static inline struct audit_context *audit_context(void) { return NULL; }
#endif
which means the call to syscall_enter_audit() should not ever end up in
the linker phase due to dead code elimination.
Such constructs which rely on dead code elimination are not unique. The
kernel is full of them.
The .config in the report builds without problems with s390-linux-gcc
15.2.0 (I verified that before merging), but fails with the version used
by the robot:
compiler: s390-linux-gcc (GCC) 13.4.0
So that's a broken compiler and without understanding the actual root
cause we are not going to paper over it.
When I disable CONFIG_KASAN in that config the problem goes away....
I have no idea how that's related especially as the code in question is
non instrumentable to begin with.
Looking at the disassembly:
if (unlikely(audit_context()))
2da: c0 e5 00 00 00 00 brasl %r14,2da <__do_syscall+0x2da>
2dc: R_390_PLT32DBL audit_context+0x2
So dead code elimination does not work because the compiler puts the
stub return NULL inline out of line....
The proper fix is below. The fixes tag wants to be:
Fixes: s390 cross GCC 13.4.0 brainfart
Thanks,
tglx
---
include/linux/audit.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/include/linux/audit.h
+++ b/include/linux/audit.h
@@ -343,7 +343,7 @@ static inline void audit_set_context(str
task->audit_context = ctx;
}
-static inline struct audit_context *audit_context(void)
+static __always_inline struct audit_context *audit_context(void)
{
return current->audit_context;
}
@@ -623,7 +623,7 @@ static inline bool audit_dummy_context(v
}
static inline void audit_set_context(struct task_struct *task, struct audit_context *ctx)
{ }
-static inline struct audit_context *audit_context(void)
+static __always_inline struct audit_context *audit_context(void)
{
return NULL;
}
next prev parent reply other threads:[~2026-07-20 15:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-20 9:49 [PATCH] entry: Provide stub for syscall_enter_audit() when auditing is disabled Jinjie Ruan
2026-07-20 15:34 ` Thomas Gleixner [this message]
2026-07-20 18:34 ` Thomas Gleixner
2026-07-21 2:41 ` Jinjie Ruan
2026-07-21 2:47 ` Jinjie Ruan
2026-07-21 7:58 ` Thomas Gleixner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87cxwhn09i.ffs@fw13 \
--to=tglx@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=luto@kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=peterz@infradead.org \
--cc=ruanjinjie@huawei.com \
--cc=svens@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox