On Thu, 2024-02-01 at 04:20 +0000, Kumar Kartikeya Dwivedi wrote: [...] > +static int mark_exception_reachable_subprogs(struct bpf_verifier_env *env) > +{ [...] > +restart: > + subprog_end = subprog[idx + 1].start; > + for (; i < subprog_end; i++) { [...] > + if (!bpf_pseudo_call(insn + i) && !bpf_pseudo_func(insn + i)) > + continue; > + /* remember insn and function to return to */ > + ret_insn[frame] = i + 1; > + ret_prog[frame] = idx; > + > + /* find the callee */ > + next_insn = i + insn[i].imm + 1; > + sidx = find_subprog(env, next_insn); > + if (sidx < 0) { > + WARN_ONCE(1, "verifier bug. No program starts at insn %d\n", next_insn); > + return -EFAULT; > + } For programs like: foo(): bar() bar() this algorithm would scan bar() multiple times. Would it be possible to remember if subprogram had been scanned already and reuse collected .is_throw_reachable info? [...]