[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <162451786327.395.11993336706320231426.tip-bot2@tip-bot2>
Date: Thu, 24 Jun 2021 06:57:43 -0000
From: "tip-bot2 for Josh Poimboeuf" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Joe Lawrence <joe.lawrence@...hat.com>,
Josh Poimboeuf <jpoimboe@...hat.com>,
Ingo Molnar <mingo@...nel.org>, x86@...nel.org,
linux-kernel@...r.kernel.org
Subject: [tip: objtool/urgent] objtool: Don't make .altinstructions writable
The following commit has been merged into the objtool/urgent branch of tip:
Commit-ID: e31694e0a7a709293319475d8001e05e31f2178c
Gitweb: https://git.kernel.org/tip/e31694e0a7a709293319475d8001e05e31f2178c
Author: Josh Poimboeuf <jpoimboe@...hat.com>
AuthorDate: Wed, 23 Jun 2021 10:42:28 -05:00
Committer: Ingo Molnar <mingo@...nel.org>
CommitterDate: Thu, 24 Jun 2021 08:55:20 +02:00
objtool: Don't make .altinstructions writable
When objtool creates the .altinstructions section, it sets the SHF_WRITE
flag to make the section writable -- unless the section had already been
previously created by the kernel. The mismatch between kernel-created
and objtool-created section flags can cause failures with external
tooling (kpatch-build). And the section doesn't need to be writable
anyway.
Make the section flags consistent with the kernel's.
Fixes: 9bc0bb50727c ("objtool/x86: Rewrite retpoline thunk calls")
Reported-by: Joe Lawrence <joe.lawrence@...hat.com>
Signed-off-by: Josh Poimboeuf <jpoimboe@...hat.com>
Signed-off-by: Ingo Molnar <mingo@...nel.org>
Link: https://lore.kernel.org/r/6c284ae89717889ea136f9f0064d914cd8329d31.1624462939.git.jpoimboe@redhat.com
---
tools/objtool/arch/x86/decode.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/objtool/arch/x86/decode.c b/tools/objtool/arch/x86/decode.c
index 523aa41..bc82105 100644
--- a/tools/objtool/arch/x86/decode.c
+++ b/tools/objtool/arch/x86/decode.c
@@ -684,7 +684,7 @@ static int elf_add_alternative(struct elf *elf,
sec = find_section_by_name(elf, ".altinstructions");
if (!sec) {
sec = elf_create_section(elf, ".altinstructions",
- SHF_WRITE, size, 0);
+ SHF_ALLOC, size, 0);
if (!sec) {
WARN_ELF("elf_create_section");
Powered by blists - more mailing lists