From 9b27cd0554c5883318256c32b2aaf060a3e20e0a Mon Sep 17 00:00:00 2001 From: Alexei Starovoitov Date: Tue, 20 Oct 2026 23:19:40 +0000 Subject: [PATCH] bpf: Reject unwind_goto and unwind_exit in offloaded progs A prog with unwind_goto or unwind_exit has to be JITed by a JIT that supports them. The driver JITs an offloaded prog, and nobody looks at jit_required there. nfp rejects unwind_goto in nfp_verify_insn(). netdevsim takes everything. Nothing runs such a prog, but it's not jited for bpf_insn_prepare_dump(), which takes unwind_goto for BPF_CALL_ARGS and shows it as a call. Fixes: a2d274771321 ("bpf: Add unwind_goto and unwind_exit insns") Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261020231942.2568163-3-alexei.starovoitov@gmail.com Closes: https://lore.kernel.org/bpf/sashiko-outbox-179499@kernel.org/ --- kernel/bpf/verifier.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c index 7d7193b087f6..5601d2056218 100644 --- a/kernel/bpf/verifier.c +++ b/kernel/bpf/verifier.c @@ -3462,7 +3462,7 @@ static int check_unwind_insns(struct bpf_verifier_env *env) } if (!seen) return 0; - if (!bpf_jit_supports_unwind()) { + if (!bpf_jit_supports_unwind() || bpf_prog_is_offloaded(env->prog->aux)) { verbose(env, "JIT does not support unwinding\n"); return -ENOTSUPP; }