linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] NET: xfrm, use correct rcu dereference helper
@ 2012-08-17 13:38 Jiri Slaby
  2012-08-18 21:08 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Jiri Slaby @ 2012-08-17 13:38 UTC (permalink / raw)
  To: davem; +Cc: netdev, jirislaby, linux-kernel, Jiri Slaby, Priyanka Jain

Use rcu_dereference_bh while holding bh rcu lock. Otherwise we get:
===============================
[ INFO: suspicious RCU usage. ]
3.6.0-rc1-next-20120816+ #10 Not tainted
-------------------------------
net/xfrm/xfrm_policy.c:2504 suspicious rcu_dereference_check() usage!

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Priyanka Jain <Priyanka.Jain@freescale.com>
---
 net/xfrm/xfrm_policy.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index 5ad4d2c..6405764 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -2501,11 +2501,11 @@ static void __net_init xfrm_dst_ops_init(struct net *net)
 	struct xfrm_policy_afinfo *afinfo;
 
 	rcu_read_lock_bh();
-	afinfo = rcu_dereference(xfrm_policy_afinfo[AF_INET]);
+	afinfo = rcu_dereference_bh(xfrm_policy_afinfo[AF_INET]);
 	if (afinfo)
 		net->xfrm.xfrm4_dst_ops = *afinfo->dst_ops;
 #if IS_ENABLED(CONFIG_IPV6)
-	afinfo = rcu_dereference(xfrm_policy_afinfo[AF_INET6]);
+	afinfo = rcu_dereference_bh(xfrm_policy_afinfo[AF_INET6]);
 	if (afinfo)
 		net->xfrm.xfrm6_dst_ops = *afinfo->dst_ops;
 #endif
-- 
1.7.11.5



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

* Re: [PATCH] NET: xfrm, use correct rcu dereference helper
  2012-08-17 13:38 [PATCH] NET: xfrm, use correct rcu dereference helper Jiri Slaby
@ 2012-08-18 21:08 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2012-08-18 21:08 UTC (permalink / raw)
  To: jslaby; +Cc: netdev, jirislaby, linux-kernel, Priyanka.Jain

From: Jiri Slaby <jslaby@suse.cz>
Date: Fri, 17 Aug 2012 15:38:36 +0200

> Use rcu_dereference_bh while holding bh rcu lock. Otherwise we get:
> ===============================
> [ INFO: suspicious RCU usage. ]
> 3.6.0-rc1-next-20120816+ #10 Not tainted
> -------------------------------
> net/xfrm/xfrm_policy.c:2504 suspicious rcu_dereference_check() usage!
> 
> Signed-off-by: Jiri Slaby <jslaby@suse.cz>
> Cc: Priyanka Jain <Priyanka.Jain@freescale.com>

Should already be fixed in net-next for at least a whole day now.

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

end of thread, other threads:[~2012-08-18 21:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-17 13:38 [PATCH] NET: xfrm, use correct rcu dereference helper Jiri Slaby
2012-08-18 21:08 ` 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).