]> git.baikalelectronics.ru Git - kernel.git/commit
objtool: Fix noreturn detection for ignored functions
authorJosh Poimboeuf <jpoimboe@redhat.com>
Thu, 10 Sep 2020 15:24:57 +0000 (10:24 -0500)
committerBorislav Petkov <bp@suse.de>
Fri, 18 Sep 2020 17:37:51 +0000 (19:37 +0200)
commitc32346d7447b96d34827e20abb021b3377da19aa
tree9eae3f90a763b5b8c551a1d46f5b11c7bedacbe5
parent490b1f9d3b599ea255de59eeb320d58c1220e31c
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

  b93843f49370 ("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
tools/objtool/check.c