linux/tools/objtool
Peter Zijlstra d54dba4199 objtool: Allow UNWIND_HINT to suppress dodgy stack modifications
rewind_stack_do_exit()
	UNWIND_HINT_FUNC
	/* Prevent any naive code from trying to unwind to our caller. */

	xorl	%ebp, %ebp
	movq	PER_CPU_VAR(cpu_current_top_of_stack), %rax
	leaq	-PTREGS_SIZE(%rax), %rsp
	UNWIND_HINT_REGS

	call	do_exit

Does unspeakable things to the stack, which objtool currently fails to
detect due to a limitation in instruction decoding. This will be
rectified after which the above will result in:

arch/x86/entry/entry_64.o: warning: objtool: .text+0xab: unsupported stack register modification

Allow the UNWIND_HINT on the next instruction to suppress this, it
will overwrite the state anyway.

Suggested-by: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Josh Poimboeuf <jpoimboe@redhat.com>
Tested-by: Nick Desaulniers <ndesaulniers@google.com>
Link: https://lkml.kernel.org/r/20210211173626.918498579@infradead.org
2021-03-06 12:44:22 +01:00
..
arch/x86 objtool,x86: Additionally decode: mov %rsp, (%reg) 2021-02-10 20:53:52 +01:00
Documentation objtool: Support stack layout changes in alternatives 2021-01-14 09:53:54 -06:00
include/objtool clang-lto for v5.12-rc1 (part2) 2021-02-23 15:13:45 -08:00
.gitignore objtool: Rework header include paths 2021-01-13 18:13:14 -06:00
Build objtool: Enable compilation of objtool for all architectures 2020-05-20 09:17:28 -05:00
builtin-check.c clang-lto for v5.12-rc1 (part2) 2021-02-23 15:13:45 -08:00
builtin-orc.c objtool: Refactor ORC section generation 2021-01-14 09:53:42 -06:00
check.c objtool: Allow UNWIND_HINT to suppress dodgy stack modifications 2021-03-06 12:44:22 +01:00
elf.c objtool updates: 2021-02-23 09:56:13 -08:00
Makefile objtool: Refactor ORC section generation 2021-01-14 09:53:42 -06:00
objtool.c clang-lto for v5.12-rc1 (part2) 2021-02-23 15:13:45 -08:00
orc_dump.c x86/unwind/orc: Change REG_SP_INDIRECT 2021-02-10 20:53:51 +01:00
orc_gen.c objtool: Support stack layout changes in alternatives 2021-01-14 09:53:54 -06:00
special.c objtool: Rework header include paths 2021-01-13 18:13:14 -06:00
sync-check.sh objtool: Make unwind hint definitions available to other architectures 2020-09-10 10:43:13 -05:00
weak.c objtool: Refactor ORC section generation 2021-01-14 09:53:42 -06:00