]> git.baikalelectronics.ru Git - kernel.git/commit
elf: Allow arch to tweak initial mmap prot flags
authorDave Martin <Dave.Martin@arm.com>
Mon, 16 Mar 2020 16:50:46 +0000 (16:50 +0000)
committerCatalin Marinas <catalin.marinas@arm.com>
Mon, 16 Mar 2020 17:19:48 +0000 (17:19 +0000)
commitbff6bccdc8b702335e5b56c44d8ce700a27058eb
tree77feaf03e85c305c35b45d870da4c473f1c0531e
parent514ce4bc4b44a9dc90fbdeaccde6d563c5d63cf0
elf: Allow arch to tweak initial mmap prot flags

An arch may want to tweak the mmap prot flags for an
ELFexecutable's initial mappings.  For example, arm64 is going to
need to add PROT_BTI for executable pages in an ELF process whose
executable is marked as using Branch Target Identification (an
ARMv8.5-A control flow integrity feature).

So that this can be done in a generic way, add a hook
arch_elf_adjust_prot() to modify the prot flags as desired: arches
can select CONFIG_HAVE_ELF_PROT and implement their own backend
where necessary.

By default, leave the prot flags unchanged.

Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
fs/Kconfig.binfmt
fs/binfmt_elf.c
include/linux/elf.h