Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
forked fromtorvalds/linux

Commit39b7353

Browse files
jpoimboeKAGA-KOKO
authored andcommitted
objtool: Detect jumps to retpoline thunks
A direct jump to a retpoline thunk is really an indirect jump indisguise. Change the objtool instruction type accordingly.Objtool needs to know where indirect branches are so it can detectswitch statement jump tables.This fixes a bunch of warnings with CONFIG_RETPOLINE like: arch/x86/events/intel/uncore_nhmex.o: warning: objtool: nhmex_rbox_msr_enable_event()+0x44: sibling call from callable instruction with modified stack frame kernel/signal.o: warning: objtool: copy_siginfo_to_user()+0x91: sibling call from callable instruction with modified stack frame ...Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>Signed-off-by: Thomas Gleixner <tglx@linutronix.de>Cc: gnomes@lxorguk.ukuu.org.ukCc: Rik van Riel <riel@redhat.com>Cc: Andi Kleen <ak@linux.intel.com>Cc: thomas.lendacky@amd.comCc: Peter Zijlstra <peterz@infradead.org>Cc: Linus Torvalds <torvalds@linux-foundation.org>Cc: Jiri Kosina <jikos@kernel.org>Cc: Andy Lutomirski <luto@amacapital.net>Cc: Dave Hansen <dave.hansen@intel.com>Cc: Kees Cook <keescook@google.com>Cc: Tim Chen <tim.c.chen@linux.intel.com>Cc: Greg Kroah-Hartman <gregkh@linux-foundation.org>Cc: Paul Turner <pjt@google.com>Link:https://lkml.kernel.org/r/1515707194-20531-2-git-send-email-dwmw@amazon.co.uk
1 parent445b69e commit39b7353

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

‎tools/objtool/check.c‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,13 @@ static int add_jump_destinations(struct objtool_file *file)
456456
}elseif (rela->sym->sec->idx) {
457457
dest_sec=rela->sym->sec;
458458
dest_off=rela->sym->sym.st_value+rela->addend+4;
459+
}elseif (strstr(rela->sym->name,"_indirect_thunk_")) {
460+
/*
461+
* Retpoline jumps are really dynamic jumps in
462+
* disguise, so convert them accordingly.
463+
*/
464+
insn->type=INSN_JUMP_DYNAMIC;
465+
continue;
459466
}else {
460467
/* sibling call */
461468
insn->jump_dest=0;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp