linux-stable/tools
Peter Zijlstra dab72c3c32 objtool: Add entry UNRET validation
commit a09a6e2399 upstream.

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>
[cascardo: tools/objtool/builtin-check.c no link option validation]
[cascardo: tools/objtool/check.c opts.ibt is ibt]
[cascardo: tools/objtool/include/objtool/builtin.h leave unret option as bool, no struct opts]
[cascardo: objtool is still called from scripts/link-vmlinux.sh]
[cascardo: no IBT support]
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-23 12:54:06 +02:00
..
accounting
arch KVM: x86/speculation: Disable Fill buffer clear within guests 2022-06-16 13:30:34 +02:00
bootconfig tools/bootconfig: Define memblock_free_ptr() to fix build error 2021-09-15 09:49:48 -07:00
bpf bpftool: Fix the error when lookup in no-btf maps 2022-04-08 14:23:31 +02:00
build perf build: Fix btf__load_from_kernel_by_id() feature check 2022-06-09 10:23:16 +02:00
cgroup
debugging
edid
firewire
firmware
gpio
hv
iio
include objtool: Add entry UNRET validation 2022-07-23 12:54:06 +02:00
io_uring
kvm/kvm_stat KVM: kvm_stat: do not show halt_wait_ns 2021-10-18 14:07:18 -04:00
laptop
leds
lib libbpf: Fix logic for finding matching program for CO-RE relocation 2022-06-09 10:22:51 +02:00
memory-model
objtool objtool: Add entry UNRET validation 2022-07-23 12:54:06 +02:00
pci
pcmcia
perf perf build-id: Fix caching files with a wrong build ID 2022-06-29 09:03:31 +02:00
power tools/power turbostat: fix ICX DRAM power numbers 2022-06-09 10:22:32 +02:00
rcu
scripts
spi
testing selftests/net: fix section name when using xdp_dummy.o 2022-07-12 16:35:19 +02:00
thermal/tmon
time
tracing tools/latency-collector: Use correct size when writing queue_full_warning 2021-11-18 19:16:19 +01:00
usb usb: testusb: Fix for showing the connection speed 2021-09-14 10:31:41 +02:00
virtio tools/virtio: compile with -pthread 2022-05-25 09:57:25 +02:00
vm tools/vm/page-types: remove dependency on opt_file for idle page tracking 2021-09-24 16:13:35 -07:00
wmi
Makefile