objtool: Correctly handle retpoline thunk calls
commit bcb1b6ff39 upstream.
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@infradead.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Reviewed-by: Miroslav Benes <mbenes@suse.cz>
Link: https://lkml.kernel.org/r/20210326151259.567568238@infradead.org
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
28ca351296
commit
6e95f8caff
@@ -953,6 +953,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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user