twx-linux/tools
Josh Poimboeuf ae7e9d29a3 objtool: Fix INSN_CONTEXT_SWITCH handling in validate_unret()
[ Upstream commit a8df7d0ef92eca28c610206c6748daf537ac0586 ]

The !CONFIG_IA32_EMULATION version of xen_entry_SYSCALL_compat() ends
with a SYSCALL instruction which is classified by objtool as
INSN_CONTEXT_SWITCH.

Unlike validate_branch(), validate_unret() doesn't consider
INSN_CONTEXT_SWITCH in a non-function to be a dead end, so it keeps
going past the end of xen_entry_SYSCALL_compat(), resulting in the
following warning:

  vmlinux.o: warning: objtool: xen_reschedule_interrupt+0x2a: RET before UNTRAIN

Fix that by adding INSN_CONTEXT_SWITCH handling to validate_unret() to
match what validate_branch() is already doing.

Fixes: a09a6e2399ba ("objtool: Add entry UNRET validation")
Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: https://lore.kernel.org/r/f5eda46fd09f15b1f5cde3d9ae3b92b958342add.1744095216.git.jpoimboe@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-04-25 10:45:05 +02:00
..
accounting
arch tools/x86/kcpuid: Protect against faulty "max subleaf" values 2024-10-10 11:57:29 +02:00
bootconfig tools/bootconfig: Fix the wrong format specifier 2025-02-08 09:52:28 +01:00
bpf bpftool: fix potential NULL pointer dereferencing in prog_dump() 2024-12-14 19:59:48 +01:00
build
certs
cgroup
counter
crypto/ccp
debugging
edid
firewire
firmware
gpio
hv tools: hv: change permissions of NetworkManager configuration file 2024-12-27 13:58:46 +01:00
iio tools/iio: Add memory allocation failure check for trigger_name 2024-10-17 15:24:20 +02:00
include memblock tests: fix implicit declaration of function 'numa_valid_node' 2025-01-17 13:36:14 +01:00
kvm/kvm_stat
laptop
leds
lib libbpf: Fix hypothetical STT_SECTION extern NULL deref case 2025-04-10 14:37:30 +02:00
memory-model
mm tools/mm: fix compile error 2024-11-22 15:38:33 +01:00
net/ynl
objtool objtool: Fix INSN_CONTEXT_SWITCH handling in validate_unret() 2025-04-25 10:45:05 +02:00
pci
pcmcia
perf perf tools: annotate asm_pure_loop.S 2025-04-10 14:37:35 +02:00
power cpupower: fix TSC MHz calculation 2025-02-08 09:51:52 +01:00
rcu
scripts tools: Override makefile ARCH variable if defined, but empty 2024-12-14 19:59:49 +01:00
spi
testing selftests/futex: futex_waitv wouldblock test should fail 2025-04-25 10:45:05 +02:00
thermal
time
tracing rtla/timerlat_top: Set OSNOISE_WORKLOAD for kernel threads 2025-03-07 16:45:49 +01:00
usb usbip: tools: Fix detach_port() invalid port error path 2024-11-08 16:28:22 +01:00
verification verification/dot2: Improve dot parser robustness 2024-12-14 20:00:13 +01:00
virtio
wmi
workqueue
Makefile