arm64/bti: Fix kernel BTI issues with livepatch, large kernels, toolchains
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest12 patches 11 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/12 | arm64/bti: Add BTI landing pad to __sdei_asm_handler()arch/ | +1 | 0 replies | |
| 2/12 | arm64/module: Fix BTI exceptions caused by omitted landing pads in Clang 21arch/ arch/ | +191 | 7 replies | |
| 3/12 | arm64/bti: Fix BTI linker failures with long branches into .idmap.textarch/ arch/ arch/ +2 more | +11 | 1 reply | |
| 4/12 | arm64/bti: Work around ld crash caused by linker script aliasesarch/ arch/ arch/ +2 more | +8 | 0 replies | |
| 5/12 | arm64/bti: Add link error for large kernels with BTI and unsupported toolchainsarch/ arch/ | +12 | 0 replies | |
| 6/12 | arm64/bti: Add link error for large kernels with BTI and livepatcharch/ | +7 | 0 replies | |
| 7/12 | arm64/bti: Advertise BTI in assembly objectsarch/ arch/ | +36 | 1 reply | |
| 8/12 | arm64/bti: Enable BTI in the pi/ startup codearch/ | +7 | 0 replies | |
| 9/12 | efi/libstub: Preserve the GNU property notedrivers/ | +8 | 0 replies | |
| 10/12 | efi/libstub: Remove obsolete .note.gnu.property workarounddrivers/ | +0 | 2 replies | |
| 11/12 | arm64/bti: Force-enable BTI linker veneersarch/ | +1 | 0 replies | |
| 12/12 | arm64/bti: Enable kernel BTI for GCCarch/ | +0 | 0 replies |
Reviews trailers per patch
1 of 12 patches has a Reviewed-by or Acked-by.
| Patch | Nick Desaulniers |
|---|---|
| 1/12 | |
| 2/12 | |
| 3/12 | |
| 4/12 | |
| 5/12 | |
| 6/12 | |
| 7/12 | |
| 8/12 | |
| 9/12 | |
| 10/12 | R-b |
| 11/12 | |
| 12/12 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 00/12] arm64/bti: Fix kernel BTI issues with livepatch, large kernels, 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/[email protected]
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
Signature · 1 line
2.55.0