Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] arm64: Implement support for BTI veneers
@ 2026-08-12 16:20 Ard Biesheuvel
  2026-08-12 16:21 ` [PATCH 1/2] arm64: module: Emit BTI veneers for cross-section calls Ard Biesheuvel
  2026-08-12 16:21 ` [PATCH 2/2] DONOTMERGE: arm64: module: Test module for BTI veneers Ard Biesheuvel
  0 siblings, 2 replies; 3+ messages in thread
From: Ard Biesheuvel @ 2026-08-12 16:20 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: linux-kernel, will, catalin.marinas, mark.rutland, Ard Biesheuvel,
	Mark Brown, Josh Poimboeuf, Nick Desaulniers

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.

Cc: Mark Brown <broonie@kernel.org>
Cc: Josh Poimboeuf <jpoimboe@kernel.org>
Cc: Nick Desaulniers <ndesaulniers@google.com>

Link: https://lore.kernel.org/all/ed4fe1f95071897859ec7fbe9176246cbd4962bf.1786138806.git.jpoimboe@kernel.org/

Ard Biesheuvel (2):
  arm64: module: Emit BTI veneers for cross-section calls
  DONOTMERGE: arm64: module: Test module for BTI veneers

 arch/arm64/Kconfig                  |   2 -
 arch/arm64/include/asm/module.h     |  12 ++
 arch/arm64/include/asm/module.lds.h |   3 +
 arch/arm64/kernel/Makefile          |   1 +
 arch/arm64/kernel/bti_veneer_test.c |  26 ++++
 arch/arm64/kernel/module-plts.c     | 128 +++++++++++++++++++-
 6 files changed, 165 insertions(+), 7 deletions(-)
 create mode 100644 arch/arm64/kernel/bti_veneer_test.c

-- 
2.47.3



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-08-12 16:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-12 16:20 [PATCH 0/2] arm64: Implement support for BTI veneers Ard Biesheuvel
2026-08-12 16:21 ` [PATCH 1/2] arm64: module: Emit BTI veneers for cross-section calls Ard Biesheuvel
2026-08-12 16:21 ` [PATCH 2/2] DONOTMERGE: arm64: module: Test module for BTI veneers Ard Biesheuvel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox