Skip to content

arm64: Enable BTI for the executable as well as the interpreter

Mark Brown linux-arch linux-arm-kernel 12 versions – Applied

Status from this message: Applied to for-next/execve, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v13 Latest2 patches 12 repliesApplied
  2. v122 patches 0 repliesSuperseded
  3. v112 patches 3 repliesSuperseded
Earlier versions · 9
VersionPostedPatchesRepliesStatus
v102 patches5 repliesApplied
v84 patches13 repliesSuperseded
v74 patches18 repliesSuperseded
v64 patches0 repliesSuperseded
v54 patches1 replySuperseded
v44 patches4 repliesSuperseded
v34 patches1 replySuperseded
v23 patches17 repliesSuperseded
v13 patches0 repliesSuperseded

Changes in v13 from the cover letter

- Rebase onto v5.18-rc3.

Patches in v13 Applied

#Subject and filesSizeRepliesApplied
1/2elf: Allow architectures to parse properties on the main executablearch/arm64/include/asm/elf.h fs/binfmt_elf.c include/linux/elf.h+29 -121 reply
2/2arm64: Enable BTI for main executable as well as the interpreterarch/arm64/include/asm/elf.h arch/arm64/kernel/process.c+51 -160 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchJeremy LintonDave MartinCatalin MarinasKees Cook
1/2T-b R-b R-b A-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v13 thread

Cover letter [PATCH v13 0/2] arm64: Enable BTI for the executable as well as the interpreter

Deployments of BTI on arm64 have run into issues interacting with systemd's MemoryDenyWriteExecute feature. Currently for dynamically linked executables the kernel will only handle architecture specific properties like BTI for the interpreter, the expectation is that the interpreter will then handle any properties on the main executable. For BTI this means remapping the executable segments PROT_EXEC | PROT_BTI.

This interacts poorly with MemoryDenyWriteExecute since that is implemented using a seccomp filter which prevents setting PROT_EXEC on already mapped memory and lacks the context to be able to detect that memory is already mapped with PROT_EXEC. This series resolves this by providing a sysctl which when enabled will cause the kernel to handle the BTI property for both the interpreter and the main executable.

v13:
- Rebase onto v5.18-rc3.
v12:
- Rebase onto v5.18-rc1.
v11:
- Ignore extra PT_INTERPs.
v10:
- Add a sysctl abi.bti_main controlling the new behaviour.
v9:
- Rebase onto v5.17-rc3.
v8:
- Rebase onto v5.17-rc1.
v7:
- Rebase onto v5.16-rc1.
v6:
- Rebase onto v5.15-rc1.
v5:
- Rebase onto v5.14-rc2.
- Tweak changelog on patch 1.
- Use the helper for interpreter/executable flag in elf.h as well.
v4:
- Rebase onto v5.14-rc1.
v3:
- Fix passing of properties for parsing by the main executable.
- Drop has_interp from arch_parse_elf_property().
- Coding style tweaks.
v2:
- Add a patch dropping has_interp from arch_adjust_elf_prot()
- Fix bisection issue with static executables on arm64 in the first patch.

Mark Brown (2):
elf: Allow architectures to parse properties on the main executable
arm64: Enable BTI for main executable as well as the interpreter

 arch/arm64/include/asm/elf.h | 14 ++++++++--
 arch/arm64/kernel/process.c  | 52 +++++++++++++++++++++++++++---------
 fs/binfmt_elf.c              | 34 ++++++++++++++++-------
 include/linux/elf.h          |  4 ++-
 4 files changed, 78 insertions(+), 26 deletions(-)

base-commit: b2d229d4ddb17db541098b83524d901257e93845

Signature · 1 line
2.30.2