Re: [PATCH] bpf: restrict verifier access to bpf_lru_node.ref

From: Martin KaFai Lau
Date: Wed Jul 16 2025 - 16:03:01 EST


On 7/15/25 11:32 PM, Shankari Anand wrote:
I think the percpu_freelist used in the regular hashmap should have similar
behavior, so may be worth finding a common solution, such as waiting for a rcu
gp before reusing it.
To resolve this, would it make sense to ensure that elements popped
from the free list are only reused after a grace period? Similar to
how other parts of the kernel manage safe object reuse.

The reuse behavior has been there for a long time. It had been discussed
before. Please go back to those threads for the background
and the direction that it is going. This thread is a good start:

https://lore.kernel.org/bpf/20250204082848.13471-3-hotforest@xxxxxxxxx/