Re: [PATCH bpf] bpf: fix reading neigh ha in bpf_fib_lookup()

From: Nikhil Ludder

Date: Wed Sep 09 2026 - 17:04:10 EST


On Wed, Sep 9, 2026 at 1:18 PM Emil Tsalapatis <linux-lists@xxxxxxxxxxxxxxx> wrote:
> Bot is right wrt possible lockups, please adjust the seqlock
> accordingly. Also please
> add your full name in the SOB.

Will fix the SOB in v2, thanks.

On the lockup: I don't think it can happen here. neigh->ha_lock has
exactly one writer in the tree, __neigh_update() at
net/core/neighbour.c:1495, and it already runs with softirqs disabled:
write_lock_bh(&neigh->lock) at line 1384 covers it through
write_unlock_bh() at line 1524. A reader in softirq context therefore
cannot preempt the writer on the same CPU and spin on the sequence
count.

The same pattern is already used by the other lockless readers of
neigh->ha on the tx path, neigh_resolve_output() and
neigh_connected_output() (neighbour.c:1610 and :1639), and by the two
recent fixes this patch follows, 57549ab90791 ("net: bridge: arp/nd
proxy: fix reading neigh ha") and b824059a673b ("vxlan: fix reading
neigh ha").

Am I missing a writer path? If you would still prefer a different
form here, I am happy to respin.

Thanks,
Nikhil