[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <161744825935.29796.15831819438789568534.tip-bot2@tip-bot2>
Date: Sat, 03 Apr 2021 11:10:59 -0000
From: "tip-bot2 for Peter Zijlstra" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: "Peter Zijlstra (Intel)" <peterz@...radead.org>,
Borislav Petkov <bp@...e.de>, Ingo Molnar <mingo@...nel.org>,
Miroslav Benes <mbenes@...e.cz>, x86@...nel.org,
linux-kernel@...r.kernel.org
Subject: [tip: x86/core] objtool: Correctly handle retpoline thunk calls
The following commit has been merged into the x86/core branch of tip:
Commit-ID: bcb1b6ff39da7e8a6a986eb08126fba2b5e13c32
Gitweb: https://git.kernel.org/tip/bcb1b6ff39da7e8a6a986eb08126fba2b5e13c32
Author: Peter Zijlstra <peterz@...radead.org>
AuthorDate: Fri, 26 Mar 2021 16:12:03 +01:00
Committer: Ingo Molnar <mingo@...nel.org>
CommitterDate: Fri, 02 Apr 2021 12:42:54 +02:00
objtool: Correctly handle retpoline thunk calls
Just like JMP handling, convert a direct CALL to a retpoline thunk
into a retpoline safe indirect CALL.
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Signed-off-by: Borislav Petkov <bp@...e.de>
Signed-off-by: Ingo Molnar <mingo@...nel.org>
Reviewed-by: Miroslav Benes <mbenes@...e.cz>
Link: https://lkml.kernel.org/r/20210326151259.567568238@infradead.org
---
tools/objtool/check.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index d45f018..519af4b 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -1025,6 +1025,18 @@ static int add_call_destinations(struct objtool_file *file)
dest_off);
return -1;
}
+
+ } else if (!strncmp(reloc->sym->name, "__x86_indirect_thunk_", 21)) {
+ /*
+ * Retpoline calls are really dynamic calls in
+ * disguise, so convert them accordingly.
+ */
+ insn->type = INSN_CALL_DYNAMIC;
+ insn->retpoline_safe = true;
+
+ remove_insn_ops(insn);
+ continue;
+
} else
insn->call_dest = reloc->sym;
Powered by blists - more mailing lists