Message ID | 1465971057-16660-1-git-send-email-ying.xue@windriver.com |
---|---|
State | Accepted, archived |
Delegated to: | David Miller |
Headers | show |
From: Ying Xue <ying.xue@windriver.com> Date: Wed, 15 Jun 2016 14:10:57 +0800 > When run tipcTS&tipcTC test suite, the following complaint appears: ... > The warning appears as rtnl_dereference() is wrongly used in > tipc_l2_send_msg() under RCU read lock protection. Instead the proper > usage should be that rcu_dereference_rtnl() is called here. > > Fixes: 5b7066c3dd24 ("tipc: stricter filtering of packets in bearer layer") > Acked-by: Jon Maloy <jon.maloy@ericsson.com> > Signed-off-by: Ying Xue <ying.xue@windriver.com> Applied.
diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c index 6f11c62..bf8f05c 100644 --- a/net/tipc/bearer.c +++ b/net/tipc/bearer.c @@ -405,7 +405,7 @@ int tipc_l2_send_msg(struct net *net, struct sk_buff *skb, return 0; /* Send RESET message even if bearer is detached from device */ - tipc_ptr = rtnl_dereference(dev->tipc_ptr); + tipc_ptr = rcu_dereference_rtnl(dev->tipc_ptr); if (unlikely(!tipc_ptr && !msg_is_reset(buf_msg(skb)))) goto drop;