From: Mark Brown Date: Mon, 23 Mar 2020 17:01:19 +0000 (+0000) Subject: arm64: bti: Document behaviour for dynamically linked binaries X-Git-Tag: v5.10.7~2348^2~9^2~16^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5d1b631c773ffbbadcbb3176a2ae0ea9d1c114c7;p=platform%2Fkernel%2Flinux-rpi.git arm64: bti: Document behaviour for dynamically linked binaries For dynamically linked binaries the interpreter is responsible for setting PROT_BTI on everything except itself. The dynamic linker needs to be aware of PROT_BTI, for example in order to avoid dropping that when marking executable pages read only after doing relocations, and doing everything in userspace ensures that we don't get any issues due to divergences in behaviour between the kernel and dynamic linker within a single executable. Add a comment indicating that this is intentional to the code to help people trying to understand what's going on. Signed-off-by: Mark Brown Signed-off-by: Catalin Marinas --- diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c index 24af13d..127aee4 100644 --- a/arch/arm64/kernel/process.c +++ b/arch/arm64/kernel/process.c @@ -674,6 +674,11 @@ asmlinkage void __sched arm64_preempt_schedule_irq(void) int arch_elf_adjust_prot(int prot, const struct arch_elf_state *state, bool has_interp, bool is_interp) { + /* + * For dynamically linked executables the interpreter is + * responsible for setting PROT_BTI on everything except + * itself. + */ if (is_interp != has_interp) return prot;