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: a2d2747713 ("bpf: Add unwind_goto and unwind_exit insns")
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261020231942.2568163-3-alexei.starovoitov@gmail.com
Closes: https://lore.kernel.org/bpf/sashiko-outbox-179499@kernel.org/
This commit is contained in:
Alexei Starovoitov 2026-10-20 23:19:40 +00:00
parent 2e320ea9a8
commit 9b27cd0554
No known key found for this signature in database

View File

@ -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;
}