summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorAlexei Starovoitov <ast@kernel.org>2026-10-20 23:19:40 +0000
committerAlexei Starovoitov <ast@kernel.org>2026-10-21 17:50:51 +0000
commit9b27cd0554c5883318256c32b2aaf060a3e20e0a (patch)
tree42f45a208385df13856749e8fe16507635ddc6cd /kernel
parent2e320ea9a883b307bed2a7a54af96ca0b902f902 (diff)
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 <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/
Diffstat (limited to 'kernel')
-rw-r--r--kernel/bpf/verifier.c2
1 files changed, 1 insertions, 1 deletions
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;
}