diff options
author | Peter Zijlstra <peterz@infradead.org> | 2020-04-01 16:38:19 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2020-04-22 10:53:50 +0200 |
commit | e25eea89bb8853763a22fa2547199cf96b571ba1 (patch) | |
tree | f766e439a5bb171c5c71a56943a684f0e6716723 /tools/objtool/check.h | |
parent | objtool: Better handle IRET (diff) | |
download | linux-e25eea89bb8853763a22fa2547199cf96b571ba1.tar.xz linux-e25eea89bb8853763a22fa2547199cf96b571ba1.zip |
objtool: Introduce HINT_RET_OFFSET
Normally objtool ensures a function keeps the stack layout invariant.
But there is a useful exception, it is possible to stuff the return
stack in order to 'inject' a 'call':
push $fun
ret
In this case the invariant mentioned above is violated.
Add an objtool HINT to annotate this and allow a function exit with a
modified stack frame.
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Miroslav Benes <mbenes@suse.cz>
Reviewed-by: Alexandre Chartre <alexandre.chartre@oracle.com>
Acked-by: Josh Poimboeuf <jpoimboe@redhat.com>
Link: https://lkml.kernel.org/r/20200416115118.690601403@infradead.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to '')
-rw-r--r-- | tools/objtool/check.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/objtool/check.h b/tools/objtool/check.h index 2c55f7591443..81ce27e62c04 100644 --- a/tools/objtool/check.h +++ b/tools/objtool/check.h @@ -33,9 +33,11 @@ struct instruction { unsigned int len; enum insn_type type; unsigned long immediate; - bool alt_group, dead_end, ignore, hint, save, restore, ignore_alts; + bool alt_group, dead_end, ignore, ignore_alts; + bool hint, save, restore; bool retpoline_safe; u8 visited; + u8 ret_offset; struct symbol *call_dest; struct instruction *jump_dest; struct instruction *first_jump_src; |