Message ID | 20200826164810.1029595-1-idosch@idosch.org |
---|---|
State | Accepted |
Delegated to: | David Miller |
Headers | show |
Series | [net] ipv4: Silence suspicious RCU usage warning | expand |
On 8/26/20 10:48 AM, Ido Schimmel wrote: > From: Ido Schimmel <idosch@nvidia.com> > > fib_info_notify_update() is always called with RTNL held, but not from > an RCU read-side critical section. This leads to the following warning > [1] when the FIB table list is traversed with > hlist_for_each_entry_rcu(), but without a proper lockdep expression. > > Since modification of the list is protected by RTNL, silence the warning > by adding a lockdep expression which verifies RTNL is held. > ... > > Fixes: 1bff1a0c9bbd ("ipv4: Add function to send route updates") > Signed-off-by: Ido Schimmel <idosch@nvidia.com> > --- > net/ipv4/fib_trie.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > Thanks, Ido. Reviewed-by: David Ahern <dsahern@gmail.com>
From: Ido Schimmel <idosch@idosch.org> Date: Wed, 26 Aug 2020 19:48:10 +0300 > From: Ido Schimmel <idosch@nvidia.com> > > fib_info_notify_update() is always called with RTNL held, but not from > an RCU read-side critical section. This leads to the following warning > [1] when the FIB table list is traversed with > hlist_for_each_entry_rcu(), but without a proper lockdep expression. > > Since modification of the list is protected by RTNL, silence the warning > by adding a lockdep expression which verifies RTNL is held. ... > Fixes: 1bff1a0c9bbd ("ipv4: Add function to send route updates") > Signed-off-by: Ido Schimmel <idosch@nvidia.com> Applied and queued up for -stable, thanks.
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c index c89b46fec153..ffc5332f1390 100644 --- a/net/ipv4/fib_trie.c +++ b/net/ipv4/fib_trie.c @@ -2121,7 +2121,8 @@ void fib_info_notify_update(struct net *net, struct nl_info *info) struct hlist_head *head = &net->ipv4.fib_table_hash[h]; struct fib_table *tb; - hlist_for_each_entry_rcu(tb, head, tb_hlist) + hlist_for_each_entry_rcu(tb, head, tb_hlist, + lockdep_rtnl_is_held()) __fib_info_notify_update(net, tb, info); } }