Skip to content

Commit a14fbcd

Browse files
frextritedavem330
authored andcommitted
ipmr: Fix RCU list debugging warning
ipmr_for_each_table() macro uses list_for_each_entry_rcu() for traversing outside of 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 warning at boot: [ 4.319347] ============================= [ 4.319349] WARNING: suspicious RCU usage [ 4.319351] 5.5.4-stable #17 Tainted: G E [ 4.319352] ----------------------------- [ 4.319354] net/ipv4/ipmr.c:1757 RCU-list traversed in non-reader section!! Fixes: f0ad086 ("ipv4: ipmr: support multiple tables") Signed-off-by: Amol Grover <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 95f59bf commit a14fbcd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/ipv4/ipmr.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ static void ipmr_expire_process(struct timer_list *t);
110110

111111
#ifdef CONFIG_IP_MROUTE_MULTIPLE_TABLES
112112
#define ipmr_for_each_table(mrt, net) \
113-
list_for_each_entry_rcu(mrt, &net->ipv4.mr_tables, list)
113+
list_for_each_entry_rcu(mrt, &net->ipv4.mr_tables, list, \
114+
lockdep_rtnl_is_held())
114115

115116
static struct mr_table *ipmr_mr_table_iter(struct net *net,
116117
struct mr_table *mrt)

0 commit comments

Comments
 (0)