[PATCH v2 0/2] arm64: Implement support for BTI veneers

Ard Biesheuvel ardb at kernel.org
Wed Nov 4 00:55:22 PST 2026


On Mon, 5 Oct 2026, at 13:05, Ard Biesheuvel wrote:
> From: Ard Biesheuvel <ardb at kernel.org>
>
> [ Resending this with minimal changes even though some other approaches
>   were proposed as well. [1][2] Neither of those are appropriate for
>   backporting, while this series can reasonably be applied to older
>   kernels. ]
>
> Recent toolchains will omit BTI landing pads from functions with static
> linkage that never have their address taken. If a landing pad is needed
> nonetheless, it is up to the static linker to emit a BTI veneer withing
> direct branching range of the target, and direct the call to the veneer
> instead.
>
> Modules are partially linked objects, and so there is no static linker
> that can do this for us. Instead, the module loader must see to this.
>
> So implement this for the arm64 module loader. Patch #2 contains a test
> module that was used to validate the approach.
>
> Changes since v1:
> - make HAVE_LIVE_PATCH depend on !ARM64_BTI_KERNEL, as live patch has
>   other cases where landing pads may go missing
>
> [1] https://lore.kernel.org/all/cover.1786768375.git.jpoimboe@kernel.org/
> [2] https://lore.kernel.org/all/20260822135323.795946-11-ardb+git@google.com/
>
> Cc: Mark Brown <broonie at kernel.org>
> Cc: Josh Poimboeuf <jpoimboe at kernel.org>
> Cc: Nick Desaulniers <ndesaulniers at google.com>
>
> Ard Biesheuvel (2):
>   arm64: module: Emit BTI veneers for cross-section calls
>   DONOTMERGE: arm64: module: Test module for BTI veneers
>

Ping?



More information about the linux-arm-kernel mailing list