Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/12] arm64/bti: Fix kernel BTI issues with livepatch, large kernels, toolchains
@ 2026-08-15  4:45 Josh Poimboeuf
  2026-08-15  4:45 ` [PATCH 01/12] arm64/bti: Add BTI landing pad to __sdei_asm_handler() Josh Poimboeuf
                   ` (11 more replies)
  0 siblings, 12 replies; 18+ messages in thread
From: Josh Poimboeuf @ 2026-08-15  4:45 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon
  Cc: linux-kernel, Ard Biesheuvel, linux-arm-kernel, live-patching,
	Song Liu, Miroslav Benes, Petr Mladek, Joe Lawrence, Mark Rutland,
	Mark Brown, Nick Desaulniers, Kees Cook, Nathan Chancellor,
	linux-toolchains

These patches are a continuation of the following discussions about some
bugs related to kernel BTI:

  https://lore.kernel.org/ed4fe1f95071897859ec7fbe9176246cbd4962bf.1786138806.git.jpoimboe@kernel.org
  https://lore.kernel.org/20260812162058.612202-4-ardb@kernel.org

This started as a livepatch crash investigation but quickly ballooned
into a rabbit hole of latent bugs and toolchain quirks/crashes.

The most notable patch is probably the last one, which enables BTI on GCC.

I also hit a SIGSEGV in the GNU linker, for which this series has a
workaround.  The binutils bug is here:

  https://sourceware.org/bugzilla/show_bug.cgi?id=34525

Several of these patches probably wouldn't be needed if we had a flag
like -fno-omit-bti-pads or so for both compilers, but that currently
doesn't exist, and this at least fixes things for the existing
toolchains out there.

There is some toolchain discussion about that here:

 https://github.com/llvm/llvm-project/issues/215547

Josh Poimboeuf (12):
  arm64/bti: Add BTI landing pad to __sdei_asm_handler()
  arm64/module: Fix BTI exceptions caused by omitted landing pads in
    Clang 21
  arm64/bti: Fix BTI linker failures with long branches into .idmap.text
  arm64/bti: Work around ld crash caused by linker script aliases
  arm64/bti: Add link error for large kernels with BTI and unsupported
    toolchains
  arm64/bti: Add link error for large kernels with BTI and livepatch
  arm64/bti: Advertise BTI in assembly objects
  arm64/bti: Enable BTI in the pi/ startup code
  efi/libstub: Preserve the GNU property note
  efi/libstub: Remove obsolete .note.gnu.property workaround
  arm64/bti: Force-enable BTI linker veneers
  arm64/bti: Enable kernel BTI for GCC

 arch/arm64/Kconfig                    |   9 +-
 arch/arm64/Makefile                   |   5 +
 arch/arm64/include/asm/bti-note.h     |  32 +++++
 arch/arm64/include/asm/module.h       |   5 +
 arch/arm64/kernel/cpu-reset.S         |   2 +-
 arch/arm64/kernel/entry.S             |   1 +
 arch/arm64/kernel/head.S              |   8 +-
 arch/arm64/kernel/hyp-stub.S          |   1 +
 arch/arm64/kernel/image-vars.h        |  13 +-
 arch/arm64/kernel/module-plts.c       | 186 ++++++++++++++++++++++++++
 arch/arm64/kernel/pi/Makefile         |  11 +-
 arch/arm64/kernel/sleep.S             |   2 +-
 arch/arm64/kernel/vmlinux.lds.S       |  12 ++
 arch/arm64/lib/memcpy.S               |   3 +
 arch/arm64/lib/memset.S               |   2 +
 arch/arm64/mm/cache.S                 |   1 +
 arch/arm64/mm/proc.S                  |   8 +-
 drivers/firmware/efi/libstub/Makefile |  15 ++-
 18 files changed, 282 insertions(+), 34 deletions(-)
 create mode 100644 arch/arm64/include/asm/bti-note.h

-- 
2.55.0



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

end of thread, other threads:[~2026-08-15  9:56 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-15  4:45 [PATCH 00/12] arm64/bti: Fix kernel BTI issues with livepatch, large kernels, toolchains Josh Poimboeuf
2026-08-15  4:45 ` [PATCH 01/12] arm64/bti: Add BTI landing pad to __sdei_asm_handler() Josh Poimboeuf
2026-08-15  5:01   ` sashiko-bot
2026-08-15  4:45 ` [PATCH 02/12] arm64/module: Fix BTI exceptions caused by omitted landing pads in Clang 21 Josh Poimboeuf
2026-08-15  5:00   ` sashiko-bot
2026-08-15  9:56   ` Ard Biesheuvel
2026-08-15  4:45 ` [PATCH 03/12] arm64/bti: Fix BTI linker failures with long branches into .idmap.text Josh Poimboeuf
2026-08-15  4:45 ` [PATCH 04/12] arm64/bti: Work around ld crash caused by linker script aliases Josh Poimboeuf
2026-08-15  4:45 ` [PATCH 05/12] arm64/bti: Add link error for large kernels with BTI and unsupported toolchains Josh Poimboeuf
2026-08-15  4:45 ` [PATCH 06/12] arm64/bti: Add link error for large kernels with BTI and livepatch Josh Poimboeuf
2026-08-15  4:45 ` [PATCH 07/12] arm64/bti: Advertise BTI in assembly objects Josh Poimboeuf
2026-08-15  5:03   ` sashiko-bot
2026-08-15  4:45 ` [PATCH 08/12] arm64/bti: Enable BTI in the pi/ startup code Josh Poimboeuf
2026-08-15  4:45 ` [PATCH 09/12] efi/libstub: Preserve the GNU property note Josh Poimboeuf
2026-08-15  4:45 ` [PATCH 10/12] efi/libstub: Remove obsolete .note.gnu.property workaround Josh Poimboeuf
2026-08-15  4:45 ` [PATCH 11/12] arm64/bti: Force-enable BTI linker veneers Josh Poimboeuf
2026-08-15  5:00   ` sashiko-bot
2026-08-15  4:45 ` [PATCH 12/12] arm64/bti: Enable kernel BTI for GCC Josh Poimboeuf

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