All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiayuan Chen <jiayuan.chen@linux.dev>
To: Nikhil Ludder <nikhilljatt@gmail.com>,
	Emil Tsalapatis <linux-lists@etsalapatis.com>
Cc: ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org,
	davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, eddyz87@gmail.com, memxor@gmail.com,
	martin.lau@linux.dev, song@kernel.org, yonghong.song@linux.dev,
	jolsa@kernel.org, john.fastabend@gmail.com, sdf@fomichev.me,
	horms@kernel.org, dsahern@gmail.com, hawk@kernel.org,
	razor@blackwall.org, bpf@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH bpf] bpf: fix reading neigh ha in bpf_fib_lookup()
Date: Thu, 10 Sep 2026 12:59:56 +0800	[thread overview]
Message-ID: <7f3e237e-ac5c-46af-ae21-8b437a099fe3@linux.dev> (raw)
In-Reply-To: <178898653497.1776876.10402414041023036972@gmail.com>


On 9/10/26 4:42 AM, Nikhil Ludder wrote:
> On Wed, Sep 9, 2026 at 1:18 PM Emil Tsalapatis <linux-lists@etsalapatis.com> 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.


Yes, no deadlock.


BTW, if an IPoIB device can show up here, dmac is already truncated 
today and

the packet can't be forwarded anyway.

Shouldn't we just reject addr_len != ETH_ALEN instead of open-coding the 
copy?

Then you can use the native function instead.

> 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




  reply	other threads:[~2026-09-10  5:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-09  2:40 [PATCH bpf] bpf: fix reading neigh ha in bpf_fib_lookup() Nikhil
2026-09-09  2:55 ` sashiko-bot
2026-09-09  3:31 ` bot+bpf-ci
2026-09-09 17:18 ` Emil Tsalapatis
2026-09-09 20:42   ` Nikhil Ludder
2026-09-10  4:59     ` Jiayuan Chen [this message]
2026-09-10 11:31       ` Nikhil Ludder
2026-09-10 17:46         ` Emil Tsalapatis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7f3e237e-ac5c-46af-ae21-8b437a099fe3@linux.dev \
    --to=jiayuan.chen@linux.dev \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=dsahern@gmail.com \
    --cc=eddyz87@gmail.com \
    --cc=edumazet@google.com \
    --cc=hawk@kernel.org \
    --cc=horms@kernel.org \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-lists@etsalapatis.com \
    --cc=martin.lau@linux.dev \
    --cc=memxor@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=nikhilljatt@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=razor@blackwall.org \
    --cc=sdf@fomichev.me \
    --cc=song@kernel.org \
    --cc=yonghong.song@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.