Re: [PATCH v2] audit: Force audit_context() to be always inlined

Paul Moore <[email protected]> Wed, 29 Jul 2026 13:54:06 -0400
Newsgroups org.kernel.vger.audit,org.kernel.vger.linux-kernel
Message-ID <CAHC9VhSGV+XdCdfts7rf80JBa-Sap+9uSXd-XwXqT3T4ocv-Nw@mail.gmail.com>
On Fri, Jul 24, 2026 at 10:53=E2=80=AFAM Thomas Gleixner <[email protected]> =
wrote:
> On Thu, Jul 23 2026 at 13:21, Paul Moore wrote:
> > On Tue, Jul 21, 2026 at 3:59=E2=80=AFAM Thomas Gleixner <[email protected]=
g> wrote:
> >> On Tue, Jul 21 2026 at 12:01, Jinjie Ruan wrote:
> >> > commit 6f25517010dd ("entry: Rework syscall_audit_enter()") relies o=
n
> >> > dead code elimination to remove the call to syscall_enter_audit() wh=
en
> >> > CONFIG_AUDITSYSCALL is disabled. However, with s390 GCC 13.4.0 +
> >> > CONFIG_KASAN, audit_context() is not inlined despite being marked
> >> > inline, causing an undefined reference to syscall_enter_audit().
> >> >
> >> > Force audit_context() to be __always_inline to ensure the conditiona=
l
> >> > can be constant-folded and dead code elimination works correctly.
> >> >
> >> > Signed-off-by: Jinjie Ruan <[email protected]>
> >> > Suggested-by: Thomas Gleixner <[email protected]>
> >> > Reported-by: kernel test robot <[email protected]>
> >> > Closes: https://lore.kernel.org/oe-kbuild-all/202607181530.2nx8zb3J-=
[email protected]/
> >>
> >> Obsolete. Is already in:
> >>
> >> https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?h=
=3Dcore/entry&id=3D6f25517010ddd3f8080d7e06b9b1cb1b64b73772
> >
> > It would have been nice to see that patch CC'd to the audit mailing
> > list for obvious reasons.
> >
> > Since I'm just looking at that tip tree patch now (perhaps there are
> > other preceding patches that affect this?), does it still compile
> > properly when CONFIG_AUDITSYSCALL is not defined?  With
> > syscall_trace_enter() calling out to syscall_enter_audit() that is no
> > longer inlined in the same header, and no dummy function/macro defined
> > for syscall_enter_audit() when !CONFIG_AUDITSYSCALL, it looks like
> > there might be an issue on some configurations, no?
>
> It compiles properly due to dead code elimination on everything except on
> old s390 compilers for whatever reasons.
>
> I'll bite the bullet and add the stub inline for syscall_enter_audit() ..=
.

Thanks.  Did you CC the audit mailing list?  I don't see it in my
inbox or in the lore archives of the audit list.

> though keeping audit_context() __always_inline makes a lot of sense as
> especially clang has a tendency to out of line the most trivial inlines.

That seems reasonable, but as you previously mentioned that Jinjie
Ruan's patch was "obsolete" I wanted to clarify that you are now in
favor of the patch at the top of this thread?

--=20
paul-moore.com