Re: [RFC PATCH bpf-next v2 05/11] bpf: Preserve reg->id of pointer objects after null-check
From: Eduard Zingerman <eddyz87@gmail.com>
Date: 2026-03-17 18:49:39
Also in:
bpf
From: Eduard Zingerman <eddyz87@gmail.com>
Date: 2026-03-17 18:49:39
Also in:
bpf
On Wed, 2026-03-11 at 16:46 -0700, Amery Hung wrote:
On Wed, Mar 11, 2026 at 3:30 PM Alexei Starovoitov [off-list ref] wrote:quoted
On Wed, Mar 11, 2026 at 3:26 PM Alexei Starovoitov [off-list ref] wrote:
[...]
quoted
One more thing... How does it interact with reg_is_init_pkt_pointer() ? That pointer has to have id == 0.I haven't looked deep into the case. Currently, skb is non-referenced for non-qdisc programs, so skb dynptr won't need to track it. If there is ever a need to track it, we can assign a reserved non-zero id to the unmodified pkt pointer. For reg_is_init_pkt_pointer(), it is already checking tnum_equals_const(reg->var_off, 0), so maybe it is fine to drop the id check (not sure).
Looks like dropping id == 0 check in reg_is_init_pkt_pointer() should be fine.