Re: [PATCH bpf-next v3 0/4] bpf: Check recursion per task for preemptible programs
From: Alexei Starovoitov
Date: Wed Dec 02 2026 - 20:45:03 EST
On Wed Dec 2, 2026 at 5:29 PM UTC, Andrii Nakryiko wrote:
>
> Took a bit longer with holidays and travel to finalize and polish, but
> I've switched this to the bitset-based approach, see
> https://github.com/anakryiko/wprof/pull/170/ if you are curious.
>
> The was one bit of interesting "regression" in terms of verification
> complexity (from [1]):
>
> slot = (old & 1) ? scratch_slot_get_slow(mask, old, depth) : zero;
> if (slot < 0)
> return NULL;
>
> hdr = bpf_map_lookup_elem(map, &slot);
>
> If I change "zero" above to actual "0", it causes 3x more verification
> instructions (which for the task switch handler gets me over 1mln),
> because verifier starts tracking zero const value as special branch
> everywhere, with eliding NULL check after map lookup, etc. zero global
> var mitigates that.
>
> If you get a chance, ask your AI to check if there are still holes in
> that logic, thanks!
Ohh. Interesting. Thanks for headsup. I was sure that all 'zero'
workarounds were addressed.
Will check.