]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit - tools/objtool/check.c
objtool: Track original function across branches
authorJosh Poimboeuf <jpoimboe@redhat.com>
Thu, 18 Jul 2019 01:36:47 +0000 (20:36 -0500)
committerThomas Gleixner <tglx@linutronix.de>
Thu, 18 Jul 2019 19:01:07 +0000 (21:01 +0200)
commitc705cecc8431951b4f34178e6b1db51b4a504c43
treeab0c4bca0040ad0a59879bc0953f1babee4279d3
parenta7e47f26039c26312a4144c3001b4e9fa886bd45
objtool: Track original function across branches

If 'insn->func' is NULL, objtool skips some important checks, including
sibling call validation.  So if some .fixup code does an invalid sibling
call, objtool ignores it.

Treat all code branches (including alts) as part of the original
function by keeping track of the original func value from
validate_functions().

This improves the usefulness of some clang function fallthrough
warnings, and exposes some additional kernel bugs in the process.

Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Nick Desaulniers <ndesaulniers@google.com>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/505df630f33c9717e1ccde6e4b64c5303135c25f.1563413318.git.jpoimboe@redhat.com
tools/objtool/check.c