From: Paolo Abeni <pabeni@redhat.com>
To: Ido Schimmel <idosch@nvidia.com>, Ren Wei <n05ec@lzu.edu.cn>
Cc: bridge@lists.linux.dev, netdev@vger.kernel.org,
razor@blackwall.org, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, horms@kernel.org, makita.toshiaki@lab.ntt.co.jp,
vyasevic@redhat.com, yifanwucs@gmail.com, tomapufckgml@gmail.com,
yuantan098@gmail.com, bird@lzu.edu.cn, enjou1224z@gmail.com,
zcliangcn@gmail.com
Subject: Re: [PATCH net 1/1] net: bridge: use a stable FDB dst snapshot in RCU readers
Date: Thu, 16 Apr 2026 12:41:45 +0200 [thread overview]
Message-ID: <83d4b4b9-7bb4-4395-8973-a94fdc908b59@redhat.com> (raw)
In-Reply-To: <20260414074722.GA321402@shredder>
On 4/14/26 10:05 AM, Ido Schimmel wrote:
> On Mon, Apr 13, 2026 at 05:08:46PM +0800, Ren Wei wrote:
>> From: Zhengchuan Liang <zcliangcn@gmail.com>
>>
>> Local FDB entries can be rewritten in place by `fdb_delete_local()`, which
>> updates `f->dst` to another port or to `NULL` while keeping the entry
>> alive. Several bridge RCU readers inspect `f->dst`, including
>> `br_fdb_fillbuf()` through the `brforward_read()` sysfs path.
>>
>> These readers currently load `f->dst` multiple times and can therefore
>> observe inconsistent values across the check and later dereference.
>> In `br_fdb_fillbuf()`, this means a concurrent local-FDB update can change
>> `f->dst` after the NULL check and before the `port_no` dereference,
>> leading to a NULL-ptr-deref.
>>
>> Fix this by taking a single `READ_ONCE()` snapshot of `f->dst` in each
>> affected RCU reader and using that snapshot for the rest of the access
>> sequence. Also publish the in-place `f->dst` updates in `fdb_delete_local()`
>> with `WRITE_ONCE()` so the readers and writer use matching access patterns.
>
> Sashiko is complaining [1] about missing READ_ONCE() annotations in some
> places, but I can handle them in net-next in a similar fashion to commit
> 3e19ae7c6fd6 ("net: bridge: use READ_ONCE() and WRITE_ONCE() compiler
> barriers for fdb->dst").
I agree they can be handled separately, because they don't look harmful.
I think a 'net' patch could be used for such follow-up (data race)
/P
next prev parent reply other threads:[~2026-04-16 10:41 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1776043229.git.zcliangcn@gmail.com>
2026-04-13 9:08 ` [PATCH net 1/1] net: bridge: use a stable FDB dst snapshot in RCU readers Ren Wei
2026-04-14 8:05 ` Ido Schimmel
2026-04-16 10:41 ` Paolo Abeni [this message]
2026-04-14 9:33 ` Nikolay Aleksandrov
2026-04-16 11:00 ` patchwork-bot+netdevbpf
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=83d4b4b9-7bb4-4395-8973-a94fdc908b59@redhat.com \
--to=pabeni@redhat.com \
--cc=bird@lzu.edu.cn \
--cc=bridge@lists.linux.dev \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=enjou1224z@gmail.com \
--cc=horms@kernel.org \
--cc=idosch@nvidia.com \
--cc=kuba@kernel.org \
--cc=makita.toshiaki@lab.ntt.co.jp \
--cc=n05ec@lzu.edu.cn \
--cc=netdev@vger.kernel.org \
--cc=razor@blackwall.org \
--cc=tomapufckgml@gmail.com \
--cc=vyasevic@redhat.com \
--cc=yifanwucs@gmail.com \
--cc=yuantan098@gmail.com \
--cc=zcliangcn@gmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox