[PATCH 0/4] aarch64: avoid mprotect(PROT_BTI|PROT_EXEC) [BZ #26831]

From: Szabolcs Nagy
Date: Tue Nov 03 2020 - 05:26:16 EST


Re-mmap executable segments instead of mprotecting them in
case mprotect is seccomp filtered.

For the kernel mapped main executable we don't have the fd
for re-mmap so linux needs to be updated to add BTI. (In the
presence of seccomp filters for mprotect(PROT_EXEC) the libc
cannot change BTI protection at runtime based on user space
policy so it is better if the kernel maps BTI compatible
binaries with PROT_BTI by default.)

Szabolcs Nagy (4):
elf: Pass the fd to note processing [BZ #26831]
elf: Move note processing after l_phdr is updated [BZ #26831]
aarch64: Use mmap to add PROT_BTI instead of mprotect [BZ #26831]
aarch64: Remove the bti link_map field [BZ #26831]

elf/dl-load.c | 38 ++++++++++++++++---------------
elf/rtld.c | 4 ++--
sysdeps/aarch64/dl-bti.c | 46 ++++++++++++++++++++------------------
sysdeps/aarch64/dl-prop.h | 17 +++++++-------
sysdeps/aarch64/linkmap.h | 1 -
sysdeps/generic/dl-prop.h | 6 ++---
sysdeps/generic/ldsodefs.h | 5 +++--
sysdeps/x86/dl-prop.h | 6 ++---
8 files changed, 64 insertions(+), 59 deletions(-)

--
2.17.1