Commit bcb1b6ff authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Ingo Molnar

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: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
Reviewed-by: default avatarMiroslav Benes <mbenes@suse.cz>
Link: https://lkml.kernel.org/r/20210326151259.567568238@infradead.org
parent 11925185
...@@ -1025,6 +1025,18 @@ static int add_call_destinations(struct objtool_file *file) ...@@ -1025,6 +1025,18 @@ static int add_call_destinations(struct objtool_file *file)
dest_off); dest_off);
return -1; 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 } else
insn->call_dest = reloc->sym; insn->call_dest = reloc->sym;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment