On Thu Jun 4, 2026 at 1:21 PM PDT, Alexis Lothoré (eBPF Foundation) wrote:
>  
> +bool bpf_insn_accesses_stack_only(const struct bpf_verifier_env *env,
> +                               const struct bpf_prog *prog, int insn_idx)
> +{
> +     struct bpf_insn *insn;
> +
> +     /* cBPF: we have no verifier state, do a best-effort check based on
> +      * dst/src reg
> +      */
> +     insn_idx += prog->aux->subprog_start;
> +     insn = (struct bpf_insn *)prog->insnsi + insn_idx;
> +     if (!env)
> +             return insn->dst_reg == BPF_REG_FP ||
> +                    insn->src_reg == BPF_REG_FP;
> +     return !env->insn_aux_data[insn_idx].non_stack_access;
> +}

Let's skip this function and cBPF altogether.

This effort aims to catch verifier and kfunc bugs.
cBPF doesn't have normal verifier and has plenty of unpriv gotchas.
The kernel compiled with KASAN is for debugging, but I'd like to
avoid thinking about unpriv complications with cBPF and KASAN.


Reply via email to