Re: [PATCH bpf-next 1/2] bpf: Account for preempt and IRQ state in RCU protection

From: Eduard Zingerman

Date: Mon Aug 10 2026 - 15:34:08 EST


On Mon, 2026-08-10 at 12:30 -0700, Eduard Zingerman wrote:
> On Wed, 2026-08-05 at 16:39 -0700, Ning Ding wrote:
> > Disabling preemption or local IRQs keeps the current CPU in an RCU
> > read-side critical section, but in_rcu_cs() does not account for either
> > state. The verifier therefore rejects safe kptr accesses and invalidates
> > pointers when another RCU source ends.
> >
> > Include preemption-disabled and IRQ-disabled state in in_rcu_cs().
> > Invalidate RCU-protected pointers on RCU unlock, preempt enable, or IRQ
> > restore only after the final protection ends.
> >
> > Signed-off-by: Ning Ding <dingning04@xxxxxxxxx>
> > ---
>
> Hi Ning,
>
> Thank you for identifying and fixing this issue!
>
> Acked-by: Eduard Zingerman <eddyz87@xxxxxxxxx>
>
> ...

Please disregard the above email, it was meant for the
"bpf: Compare iterator types during state pruning" series.