[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANn89iLmd7Woe5tOPTSAMgtd3B+RpaN5tSZmCGry693b5bHpkA@mail.gmail.com>
Date: Fri, 24 Oct 2025 05:36:11 -0700
From: Eric Dumazet <edumazet@...gle.com>
To: Kuniyuki Iwashima <kuniyu@...gle.com>
Cc: "David S. Miller" <davem@...emloft.net>, Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>, David Ahern <dsahern@...nel.org>, Simon Horman <horms@...nel.org>,
Kuniyuki Iwashima <kuni1840@...il.com>, netdev@...r.kernel.org
Subject: Re: [PATCH v1 net-next 4/5] neighbour: Convert RTM_SETNEIGHTBL to RCU.
On Tue, Oct 21, 2025 at 10:40 PM Kuniyuki Iwashima <kuniyu@...gle.com> wrote:
>
> neightbl_set() fetches neigh_tables[] and updates attributes under
> write_lock_bh(&tbl->lock), so RTNL is not needed.
>
> neigh_table_clear() synchronises RCU only, and rcu_dereference_rtnl()
> protects nothing here.
>
> If we released RCU after fetching neigh_tables[], there would be no
> synchronisation to block neigh_table_clear() further, so RCU is held
> until the end of the function.
>
> Another option would be to protect neigh_tables[] user with SRCU
> and add synchronize_srcu() in neigh_table_clear().
>
> But, holding RCU should be fine as we hold write_lock_bh() for the
> rest of neightbl_set() anyway.
>
> Let's perform RTM_SETNEIGHTBL under RCU and drop RTNL.
>
> Signed-off-by: Kuniyuki Iwashima <kuniyu@...gle.com>
> ---
Reviewed-by: Eric Dumazet <edumazet@...gle.com>
Powered by blists - more mailing lists