linux-stable/tools/objtool
Josh Poimboeuf db6c6a0df8 objtool: Fix noreturn detection for ignored functions
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
2020-09-18 19:37:51 +02:00
..
Documentation objtool: Add support for intra-function calls 2020-04-30 20:14:33 +02:00
arch/x86 Merge branch 'objtool/urgent' into objtool/core 2020-06-18 17:55:29 +02:00
.gitignore .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
Build objtool: Enable compilation of objtool for all architectures 2020-05-20 09:17:28 -05:00
Makefile objtool: Enable compilation of objtool for all architectures 2020-05-20 09:17:28 -05:00
arch.h Merge branch 'objtool/urgent' into objtool/core 2020-06-18 17:55:29 +02:00
builtin-check.c objtool: Enable compilation of objtool for all architectures 2020-05-20 09:17:28 -05:00
builtin-orc.c objtool: Enable compilation of objtool for all architectures 2020-05-20 09:17:28 -05:00
builtin.h objtool: Implement noinstr validation 2020-04-22 10:53:50 +02:00
cfi.h objtool: Fix !CFI insn_state propagation 2020-04-22 10:53:50 +02:00
check.c objtool: Fix noreturn detection for ignored functions 2020-09-18 19:37:51 +02:00
check.h objtool: Rename rela to reloc 2020-06-01 09:40:58 -05:00
elf.c Merge branch 'objtool/urgent' into objtool/core 2020-06-18 17:55:29 +02:00
elf.h Merge branch 'objtool/urgent' into objtool/core 2020-06-18 17:55:29 +02:00
objtool.c objtool: Exit successfully when requesting help 2020-05-20 08:32:52 -05:00
objtool.h objtool: Enable compilation of objtool for all architectures 2020-05-20 09:17:28 -05:00
orc_dump.c objtool: Enable compilation of objtool for all architectures 2020-05-20 09:17:28 -05:00
orc_gen.c Merge branch 'objtool/urgent' into objtool/core 2020-06-18 17:55:29 +02:00
special.c objtool: Rename rela to reloc 2020-06-01 09:40:58 -05:00
special.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 13 2019-05-21 11:28:45 +02:00
sync-check.sh objtool: Silence build output 2020-01-22 07:54:34 +01:00
warn.h objtool: Rename find_containing_func() 2020-03-25 18:28:29 +01:00
weak.c objtool: Enable compilation of objtool for all architectures 2020-05-20 09:17:28 -05:00