Skip to content

arm64: BTI kernel and vDSO support

Mark Brown bpf linux-arm-kernel 3 versions – Applied

Status from this message: Applied to arm64 (for-next/bti), thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest11 patches 15 repliesApplied
  2. v210 patches 27 repliesSuperseded
  3. v110 patches 5 repliesSuperseded

Changes in v3 from the cover letter

- Add a patch adding a comment about why we enable leaf support for PAC.
- Fix build of the 32 bit vDSO.
- Refactor the macro for emitting the ELF note for BTI code so that the flags are defined separately in order to make it easier to add handling for any future users.

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/11arm64: Document why we enable PAC support for leaf functionsarch/arm64/Makefile+3 -00 replies
2/11arm64: bti: Support building kernel C code using BTIarch/arm64/Makefile+4 -00 replies
3/11arm64: asm: Override SYM_FUNC_START when building the kernel with BTIarch/arm64/include/asm/linkage.h+46 -00 replies
4/11arm64: Set GP bit in kernel page tables to enable BTI for the kernelarch/arm64/include/asm/pgtable-prot.h arch/arm64/kernel/cpufeature.c arch/arm64/mm/mmu.c+31 -00 replies
5/11arm64: bpf: Annotate JITed code for BTIarch/arm64/net/bpf_jit.h arch/arm64/net/bpf_jit_comp.c+20 -01 reply
6/11arm64: mm: Mark executable text as guarded pagesarch/arm64/mm/pageattr.c+2 -20 replies
7/11arm64: bti: Provide Kconfig for kernel mode BTIarch/arm64/Kconfig+18 -00 replies
8/11arm64: asm: Provide a mechanism for generating ELF note for BTIarch/arm64/include/asm/assembler.h+50 -00 replies
9/11arm64: vdso: Annotate for BTIarch/arm64/kernel/vdso/note.S arch/arm64/kernel/vdso/sigreturn.S arch/arm64/kernel/vdso/vdso.S+9 -00 replies
10/11arm64: vdso: Force the vDSO to be linked as BTI when built for BTIarch/arm64/kernel/vdso/Makefile+3 -10 replies
11/11arm64: vdso: Map the vDSO text with guarded pages when built for BTIarch/arm64/kernel/vdso.c+5 -10 replies

Reviews trailers per patch

9 of 11 patches have a Reviewed-by or Acked-by.

PatchCatalin MarinasDaniel Borkmann
1/11
2/11R-b
3/11R-b
4/11R-b
5/11R-b A-b
6/11R-b
7/11R-b
8/11
9/11R-b
10/11R-b
11/11R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 00/11] arm64: BTI kernel and vDSO support

This patch series adds support for protecting the kernel and vDSO with BTI including code compiled with the BPF JIT at runtime.

We build the kernel with annotations for BTI and then map 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, currently no such implementations exist.

This series depends on several branches in the arm64 tree:

- for-next/bti-user
- for-next/insn
- for-next/asm

v3:
- Add a patch adding a comment about why we enable leaf support for PAC.
- Fix build of the 32 bit vDSO.
- Refactor the macro for emitting the ELF note for BTI code so that the flags are defined separately in order to make it easier to add handling for any future users.
v2:
- Enable support for building with GCC version 10 and later, a fix for BTI code generation is being backported to GCC 9 but is not yet available.
- Add BPF support.
- Remove some unused page attribute defines.
- One assembler modernisation patch has been removed and sent separately.

Mark Brown (11):
arm64: Document why we enable PAC support for leaf functions
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: bpf: Annotate JITed code for BTI
arm64: mm: Mark executable text as guarded pages
arm64: bti: Provide Kconfig for kernel mode BTI
arm64: asm: Provide a mechanism for generating ELF note for BTI
arm64: vdso: Annotate for BTI
arm64: vdso: Force the vDSO to be linked as BTI when built for BTI
arm64: vdso: Map the vDSO text with guarded pages when built for BTI

 arch/arm64/Kconfig                    | 18 ++++++++++
 arch/arm64/Makefile                   |  7 ++++
 arch/arm64/include/asm/assembler.h    | 50 +++++++++++++++++++++++++++
 arch/arm64/include/asm/linkage.h      | 46 ++++++++++++++++++++++++
 arch/arm64/include/asm/pgtable-prot.h |  3 ++
 arch/arm64/kernel/cpufeature.c        |  4 +++
 arch/arm64/kernel/vdso.c              |  6 +++-
 arch/arm64/kernel/vdso/Makefile       |  4 ++-
 arch/arm64/kernel/vdso/note.S         |  3 ++
 arch/arm64/kernel/vdso/sigreturn.S    |  3 ++
 arch/arm64/kernel/vdso/vdso.S         |  3 ++
 arch/arm64/mm/mmu.c                   | 24 +++++++++++++
 arch/arm64/mm/pageattr.c              |  4 +--
 arch/arm64/net/bpf_jit.h              |  8 +++++
 arch/arm64/net/bpf_jit_comp.c         | 12 +++++++
 15 files changed, 191 insertions(+), 4 deletions(-)
Signature · 7 lines
2.20.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel