linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ip6mr: Fix RCU list debugging warning
@ 2020-02-22 16:57 Amol Grover
  2020-02-24 21:19 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Amol Grover @ 2020-02-22 16:57 UTC (permalink / raw)
  To: David S . Miller, Alexey Kuznetsov, Hideaki YOSHIFUJI, Jakub Kicinski
  Cc: linux-kernel, linux-kernel-mentees, Joel Fernandes,
	Madhuparna Bhowmik, Paul E . McKenney, netdev, Amol Grover

ip6mr_for_each_table() macro uses list_for_each_entry_rcu()
for traversing outside an RCU read side critical section
but under the protection of rtnl_mutex. Hence add the
corresponding lockdep expression to silence the following
false-positive warnings:

[    4.319479] =============================
[    4.319480] WARNING: suspicious RCU usage
[    4.319482] 5.5.4-stable #17 Tainted: G            E
[    4.319483] -----------------------------
[    4.319485] net/ipv6/ip6mr.c:1243 RCU-list traversed in non-reader section!!

[    4.456831] =============================
[    4.456832] WARNING: suspicious RCU usage
[    4.456834] 5.5.4-stable #17 Tainted: G            E
[    4.456835] -----------------------------
[    4.456837] net/ipv6/ip6mr.c:1582 RCU-list traversed in non-reader section!!

Signed-off-by: Amol Grover <frextrite@gmail.com>
---
 net/ipv6/ip6mr.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c
index bfa49ff70531..d6483926f449 100644
--- a/net/ipv6/ip6mr.c
+++ b/net/ipv6/ip6mr.c
@@ -97,7 +97,8 @@ static void ipmr_expire_process(struct timer_list *t);
 
 #ifdef CONFIG_IPV6_MROUTE_MULTIPLE_TABLES
 #define ip6mr_for_each_table(mrt, net) \
-	list_for_each_entry_rcu(mrt, &net->ipv6.mr6_tables, list)
+	list_for_each_entry_rcu(mrt, &net->ipv6.mr6_tables, list, \
+				lockdep_rtnl_is_held())
 
 static struct mr_table *ip6mr_mr_table_iter(struct net *net,
 					    struct mr_table *mrt)
-- 
2.24.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ip6mr: Fix RCU list debugging warning
  2020-02-22 16:57 [PATCH] ip6mr: Fix RCU list debugging warning Amol Grover
@ 2020-02-24 21:19 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-02-24 21:19 UTC (permalink / raw)
  To: frextrite
  Cc: kuznet, yoshfuji, kuba, linux-kernel, linux-kernel-mentees, joel,
	madhuparnabhowmik10, paulmck, netdev

From: Amol Grover <frextrite@gmail.com>
Date: Sat, 22 Feb 2020 22:27:27 +0530

> ip6mr_for_each_table() macro uses list_for_each_entry_rcu()
> for traversing outside an RCU read side critical section
> but under the protection of rtnl_mutex. Hence add the
> corresponding lockdep expression to silence the following
> false-positive warnings:
> 
> [    4.319479] =============================
> [    4.319480] WARNING: suspicious RCU usage
> [    4.319482] 5.5.4-stable #17 Tainted: G            E
> [    4.319483] -----------------------------
> [    4.319485] net/ipv6/ip6mr.c:1243 RCU-list traversed in non-reader section!!
> 
> [    4.456831] =============================
> [    4.456832] WARNING: suspicious RCU usage
> [    4.456834] 5.5.4-stable #17 Tainted: G            E
> [    4.456835] -----------------------------
> [    4.456837] net/ipv6/ip6mr.c:1582 RCU-list traversed in non-reader section!!
> 
> Signed-off-by: Amol Grover <frextrite@gmail.com>

Applied, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-02-24 21:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-22 16:57 [PATCH] ip6mr: Fix RCU list debugging warning Amol Grover
2020-02-24 21:19 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).