diff options
author | Peter Zijlstra <peterz@infradead.org> | 2022-06-14 23:16:03 +0200 |
---|---|---|
committer | Borislav Petkov <bp@suse.de> | 2022-06-27 10:34:00 +0200 |
commit | a09a6e2399ba0595c3042b3164f3ca68a3cff33e (patch) | |
tree | bf16062820b967a0b9c59169adf156eec8ed55a4 /scripts/Makefile.vmlinux_o | |
parent | 0fe4aeea9c01baabecc8c3afc7889c809d939bc2 (diff) | |
download | linux-stable-a09a6e2399ba0595c3042b3164f3ca68a3cff33e.tar.gz linux-stable-a09a6e2399ba0595c3042b3164f3ca68a3cff33e.tar.bz2 linux-stable-a09a6e2399ba0595c3042b3164f3ca68a3cff33e.zip |
objtool: Add entry UNRET validation
Since entry asm is tricky, add a validation pass that ensures the
retbleed mitigation has been done before the first actual RET
instruction.
Entry points are those that either have UNWIND_HINT_ENTRY, which acts
as UNWIND_HINT_EMPTY but marks the instruction as an entry point, or
those that have UWIND_HINT_IRET_REGS at +0.
This is basically a variant of validate_branch() that is
intra-function and it will simply follow all branches from marked
entry points and ensures that all paths lead to ANNOTATE_UNRET_END.
If a path hits RET or an indirection the path is a fail and will be
reported.
There are 3 ANNOTATE_UNRET_END instances:
- UNTRAIN_RET itself
- exception from-kernel; this path doesn't need UNTRAIN_RET
- all early exceptions; these also don't need UNTRAIN_RET
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
Diffstat (limited to 'scripts/Makefile.vmlinux_o')
-rw-r--r-- | scripts/Makefile.vmlinux_o | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/Makefile.vmlinux_o b/scripts/Makefile.vmlinux_o index 3c97a1564947..bc67748044a6 100644 --- a/scripts/Makefile.vmlinux_o +++ b/scripts/Makefile.vmlinux_o @@ -44,7 +44,7 @@ objtool-enabled := $(or $(delay-objtool),$(CONFIG_NOINSTR_VALIDATION)) objtool_args := \ $(if $(delay-objtool),$(objtool_args)) \ - $(if $(CONFIG_NOINSTR_VALIDATION), --noinstr) \ + $(if $(CONFIG_NOINSTR_VALIDATION), --noinstr $(if $(CONFIG_RETPOLINE), --unret)) \ $(if $(CONFIG_GCOV_KERNEL), --no-unreachable) \ --link |