diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c index 5c8626215ee6..cf9ff37cfdf2 100644 --- a/kernel/bpf/verifier.c +++ b/kernel/bpf/verifier.c @@ -11216,10 +11216,6 @@ static int check_func_callx(struct bpf_verifier_env *env, struct bpf_insn *insn, const char *reason; int err, subprog; - err = require_callx_jit(env); - if (err) - return err; - err = check_reg_arg(env, insn->dst_reg, SRC_OP); if (err) return err; @@ -11245,6 +11241,11 @@ static int check_func_callx(struct bpf_verifier_env *env, struct bpf_insn *insn, if (err) return err; + /* the callx is valid, but only a JIT can execute it */ + err = require_callx_jit(env); + if (err) + return err; + /* PTR_TO_FUNC is a pointer to a static subprog */ subprog = reg->subprogno; err = btf_check_subprog_call(env, subprog, caller->regs);