linux-stable/tools/objtool
Josh Poimboeuf a59182b3c1 objtool: Fix noreturn detection for ignored functions
[ Upstream commit db6c6a0df8 ]

When a function is annotated with STACK_FRAME_NON_STANDARD, objtool
doesn't validate its code paths.  It also skips sibling call detection
within the function.

But sibling call detection is actually needed for the case where the
ignored function doesn't have any return instructions.  Otherwise
objtool naively marks the function as implicit static noreturn, which
affects the reachability of its callers, resulting in "unreachable
instruction" warnings.

Fix it by just enabling sibling call detection for ignored functions.
The 'insn->ignore' check in add_jump_destinations() is no longer needed
after

  e6da956795 ("objtool: Don't use ignore flag for fake jumps").

Fixes the following warning:

  arch/x86/kvm/vmx/vmx.o: warning: objtool: vmx_handle_exit_irqoff()+0x142: unreachable instruction

which triggers on an allmodconfig with CONFIG_GCOV_KERNEL unset.

Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Link: https://lkml.kernel.org/r/5b1e2536cdbaa5246b60d7791b76130a74082c62.1599751464.git.jpoimboe@redhat.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-10-01 13:12:49 +02:00
..
arch/x86 x86/decoder: Add TEST opcode to Group3-2 2020-02-28 16:36:06 +01:00
Documentation x86/asm: Fix inline asm call constraints for Clang 2017-09-23 15:06:20 +02:00
.gitignore objtool: Move synced files to their original relative locations 2017-12-29 17:53:41 +01:00
arch.h objtool: Assume unannotated UD2 instructions are dead ends 2017-07-28 08:33:32 +02:00
Build objtool: Add ORC unwind table generation 2017-07-18 10:57:43 +02:00
builtin-check.c objtool: Add module specific retpoline rules 2018-03-15 10:54:38 +01:00
builtin-orc.c objtool: Use existing global variables for options 2018-03-15 10:54:37 +01:00
builtin.h objtool: Add module specific retpoline rules 2018-03-15 10:54:38 +01:00
cfi.h objtool: Handle GCC stack pointer adjustment bug 2017-08-30 10:48:41 +02:00
check.c objtool: Fix noreturn detection for ignored functions 2020-10-01 13:12:49 +02:00
check.h objtool: Support per-function rodata sections 2019-06-25 11:36:50 +08:00
elf.c objtool: Support GCC 9 cold subfunction naming scheme 2019-08-06 19:05:28 +02:00
elf.h objtool: Support per-function rodata sections 2019-06-25 11:36:50 +08:00
Makefile objtool: Clobber user CFLAGS variable 2019-10-05 12:47:35 +02:00
objtool.c objtool: Print top level commands on incorrect usage 2017-12-25 14:26:14 +01:00
orc.h objtool: Move synced files to their original relative locations 2017-12-29 17:53:41 +01:00
orc_dump.c objtool: Support Clang non-section symbols in ORC dump 2020-05-02 17:24:44 +02:00
orc_gen.c objtool: Warn on stripped section symbol 2018-02-07 11:12:21 -08:00
special.c objtool: Implement stack validation 2.0 2017-06-30 10:19:19 +02:00
special.h
sync-check.sh objtool: Move kernel headers/code sync check to a script 2017-12-29 17:53:42 +01:00
warn.h objtool: Implement stack validation 2.0 2017-06-30 10:19:19 +02:00