Re: [PATCH] arm64/module: Fix livepatch BTI exceptions with Clang 21+

Mark Brown <[email protected]>
Newsgroups org.kernel.vger.live-patching,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
On Mon, Aug 10, 2026 at 11:31:10AM +0100, Will Deacon wrote:
> On Fri, Aug 07, 2026 at 02:46:11PM -0700, Josh Poimboeuf wrote:

> > The following BTI exception was seen when loading a livepatch module:

> >   Internal error: Oops - BTI: 0000000036000001 [#1]  SMP
> >   pstate: 634004c9 (nZCv daIF +PAN -UAO +TCO +DIT -SSBS BTYPE=jc)
> >   pc : kill_orphaned_pgrp+0x0/0x150
> >   lr : do_exit+0x498/0xaf0 [livepatch_combined]

> > This was found by testing with klp-build and Clang 21, but the issue is
> > not specific to klp-build.  It's inherent to any livepatch module use of
> > klp relocations.

> > Previous tests with Clang 20 did not show this problem, as older Clang
> > unconditionally emits "bti c" for every C function.

> Is there an option to restore that behaviour if CONFIG_LIVEPATCH=y?
> Otherwise, I think I'd be more inclined to add yet-another dependency
> to CONFIG_ARM64_BTI_KERNEL so it's disabled if LIVEPATCH is selected.

This won't even be livepatch specific I think - I expect the same issue
can be triggered for module loading by using annotations to place
functions from the same translation unit in different sections if the
sections get placed far enough apart.  That was what was impacting GCC.
signature.asc (application/pgp-signature, 488 B)
-----BEGIN PGP SIGNATURE-----

iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmp5+4MACgkQJNaLcl1U
h9DWCwf/Xti+nVWpJHcUhn6hWKTHMFbXPU/xtxs0DQDxretJilC2YDU3AkLOsCz+
Rh/Fd8sq539JCsMpATZOU8Od41skWS33mhDmcJy2agCj4ObNs7e1V8mEF9hp9Ait
32wCO5WCOSJo4ZXGoTTxDkcU6cMn5eDYvnzOfe6FeoqyU0RIH7b4/S4joYpU88kj
vUX/Nsi98auZZ6ddIj2hWlg2nAAMxC9oFWwVTj5A8z93JZSshimwQkcOWB9OqKS5
bS/7J0KYX5wS4EJplq7pHNweCmT2tJPKG67eqhYHkolXEzu6ptzqbC9GALsm5uFE
P053/E6HJtLxJ1UYa5a9nODlmhXKEA==
=Z6Dc
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.