From: Mark Brown <broonie@kernel•org>
To: Catalin Marinas <catalin.marinas@arm•com>, Will Deacon <will@kernel•org>
Cc: Szabolcs Nagy <szabolcs.nagy@arm•com>,
Mark Rutland <mark.rutland@arm•com>,
Mark Brown <broonie@kernel•org>,
linux-arm-kernel@lists•infradead.org
Subject: [PATCH] arm64: bti: Document behaviour for dynamically linked binaries
Date: Mon, 23 Mar 2020 17:01:19 +0000 [thread overview]
Message-ID: <20200323170119.12263-1-broonie@kernel.org> (raw)
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 <broonie@kernel•org>
---
arch/arm64/kernel/process.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c
index 24af13d7bde6..9b668565dd10 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 dynamicly linked executables the interpreter is
+ * responsible for setting PROT_BTI on everything except
+ * itself.
+ */
if (is_interp != has_interp)
return prot;
--
2.20.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists•infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next reply other threads:[~2020-03-23 17:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-23 17:01 Mark Brown [this message]
2020-03-25 8:07 ` [PATCH] arm64: bti: Document behaviour for dynamically linked binaries Will Deacon
2020-03-25 9:50 ` Catalin Marinas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200323170119.12263-1-broonie@kernel.org \
--to=broonie@kernel$(echo .)org \
--cc=catalin.marinas@arm$(echo .)com \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
--cc=mark.rutland@arm$(echo .)com \
--cc=szabolcs.nagy@arm$(echo .)com \
--cc=will@kernel$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox