linux/tools
Josh Poimboeuf 0c314a881c objtool: Fix stack overflow in validate_branch()
On an allmodconfig kernel compiled with Clang, objtool is segfaulting in
drivers/scsi/qla2xxx/qla2xxx.o due to a stack overflow in
validate_branch().

Due in part to KASAN being enabled, the qla2xxx code has a large number
of conditional jumps, causing objtool to go quite deep in its recursion.

By far the biggest offender of stack usage is the recently added
'prev_state' stack variable in validate_insn(), coming in at 328 bytes.

Move that variable (and its tracing usage) to handle_insn_ops() and make
handle_insn_ops() noinline to keep its stack frame outside the recursive
call chain.

Reported-by: Nathan Chancellor <nathan@kernel.org>
Fixes: fcb268b47a ("objtool: Trace instruction state changes during function validation")
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://patch.msgid.link/21bb161c23ca0d8c942a960505c0d327ca2dc7dc.1764691895.git.jpoimboe@kernel.org
Closes: https://lore.kernel.org/20251201202329.GA3225984@ax162
2025-12-02 17:40:35 +01:00
..
accounting tools/delaytop: improve error handling for missing PSI support 2025-09-13 17:32:56 -07:00
arch Performance events changes for v6.19: 2025-12-01 20:42:01 -08:00
bootconfig bootconfig: Fix negative seeks on 32-bit with LFS enabled 2025-08-21 08:16:31 +09:00
bpf bpf: add _impl suffix for bpf_stream_vprintk() kfunc 2025-11-04 17:50:25 -08:00
build objtool updates for v6.19: 2025-12-01 20:18:59 -08:00
certs
cgroup memcg_slabinfo: Fix use of PG_slab 2025-07-23 11:55:22 +02:00
counter
crypto
debugging
docs docs: add tools/docs/gen-redirects.py 2025-09-09 13:37:16 -06:00
firewire
firmware
gpio tools: gpio: remove the include directory on make clean 2025-09-04 16:29:28 +02:00
hv
iio iio: add power and energy measurement modifiers 2025-09-13 13:47:19 +01:00
include Performance events changes for v6.19: 2025-12-01 20:42:01 -08:00
kvm/kvm_stat
laptop
leds
lib bpf: add _impl suffix for bpf_stream_vprintk() kfunc 2025-11-04 17:50:25 -08:00
memory-model
mm tools/mm/slabinfo: fix access to null terminator in string boundary 2025-09-21 14:22:00 -07:00
net tools: ynl: call nested attribute free function for indexed arrays 2025-11-10 17:18:05 -08:00
objtool objtool: Fix stack overflow in validate_branch() 2025-12-02 17:40:35 +01:00
pcmcia
perf objtool updates for v6.19: 2025-12-01 20:18:59 -08:00
power Kbuild updates for 6.18 2025-10-01 20:58:51 -07:00
rcu
sched
sched_ext tools/sched_ext: scx_qmap: Make debug output quieter by default 2025-09-23 09:03:26 -10:00
scripts tools headers: Sync syscall tables with the kernel source 2025-08-18 13:49:25 -07:00
sound
spi
testing vfs-6.19-rc1.coredump 2025-12-01 10:17:39 -08:00
thermal
time
tracing tracing/tools: Fix incorrcet short option in usage text for --threads 2025-11-07 07:59:37 -05:00
usb tools/usb/usbip: fix spelling mistakes in usbipd.c 2025-09-06 15:22:14 +02:00
verification rv: Add opid per-cpu monitor 2025-07-28 16:47:35 -04:00
virtio kmsan: convert kmsan_handle_dma to use physical addresses 2025-09-12 00:18:20 +02:00
wmi
workqueue
writeback
Makefile