mbox series

[0/5] arm64: Initial BTI kernel support

Message ID 20200327192107.18394-1-broonie@kernel.org (mailing list archive)
Headers show
Series arm64: Initial BTI kernel support | expand


Mark Brown March 27, 2020, 7:21 p.m. UTC
This patch series extends the use of BTI to most kernel executable
code, it does not currently handle BPF or the VDSO - those will be
handled by future updates.  It builds the kernel with annotations for
BTI and then maps the kernel with GP based on the support on the boot
CPU, rejecting secondaries that don't have BTI support.  If there is a
need to handle big.LITTLE systems with mismatched BTI support we will
have to revisit this but no implementations currently exist.

This is just for initial review, it obviously can't be applied until
after the merge window.  It depends on the userspace BTI patches and the
assembler annotation patches.

Since at least some versions of GCC appear to have an issue with
generating incorrect BTI annotations when BTI is used in conjunction
with pointer authentication for leaf functions this version of the
series disables building with GCC entirely.  The issue is still under
investigation, no issues have been seen with clang.

Mark Brown (5):
  arm64: bti: Support building kernel C code using BTI
  arm64: asm: Override SYM_FUNC_START when building the kernel with BTI
  arm64: Set GP bit in kernel page tables to enable BTI for the kernel
  arm64: mm: Mark module text as guarded pages
  arm64: bti: Provide Kconfig for kernel mode BTI

 arch/arm64/Kconfig                    | 18 +++++++++++
 arch/arm64/Makefile                   |  4 +++
 arch/arm64/include/asm/linkage.h      | 46 +++++++++++++++++++++++++++
 arch/arm64/include/asm/pgtable-prot.h |  5 +++
 arch/arm64/kernel/cpufeature.c        |  4 +++
 arch/arm64/mm/mmu.c                   | 24 ++++++++++++++
 arch/arm64/mm/pageattr.c              |  4 +--
 7 files changed, 103 insertions(+), 2 deletions(-)