mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
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:
parent
2e320ea9a8
commit
9b27cd0554
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user