objtool: Fix retpoline detection in asm code
authorJosh Poimboeuf <jpoimboe@redhat.com>
Thu, 21 Jan 2021 21:29:18 +0000 (15:29 -0600)
committerJosh Poimboeuf <jpoimboe@redhat.com>
Tue, 26 Jan 2021 17:11:59 +0000 (11:11 -0600)
commit1f9a1b74942485a0a29e7c4a9a9f2fe8aea17766
treefed5d10db74d928885cbac6c194893a21ca34556
parent6f567c9300a5ebd7b18c26dda1c8d6ffbdd0debd
objtool: Fix retpoline detection in asm code

The JMP_NOSPEC macro branches to __x86_retpoline_*() rather than the
__x86_indirect_thunk_*() wrappers used by C code.  Detect jumps to
__x86_retpoline_*() as retpoline dynamic jumps.

Presumably this doesn't trigger a user-visible bug.  I only found it
when testing vmlinux.o validation.

Fixes: 39b735332cb8 ("objtool: Detect jumps to retpoline thunks")
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Link: https://lore.kernel.org/r/31f5833e2e4f01e3d755889ac77e3661e906c09f.1611263461.git.jpoimboe@redhat.com
tools/objtool/arch/x86/special.c
tools/objtool/check.c
tools/objtool/include/objtool/check.h