netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [IPSEC]: Protect against BHs in xfrm_user_policy()
@ 2005-04-03 16:13 Patrick McHardy
  2005-04-04  1:20 ` Herbert Xu
  0 siblings, 1 reply; 6+ messages in thread
From: Patrick McHardy @ 2005-04-03 16:13 UTC (permalink / raw)
  To: David S. Miller; +Cc: Herbert Xu, netdev

[-- Attachment #1: Type: text/plain, Size: 131 bytes --]

xfrm_user_policy() is called from ip_setsockopt with enabled
BHs, so it needs to protect against them when grabbing
xfrm_km_lock.


[-- Attachment #2: x --]
[-- Type: text/plain, Size: 995 bytes --]

# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2005/04/03 17:36:10+02:00 kaber@coreworks.de 
#   [IPSEC]: Protect against BHs in xfrm_user_policy()
#   
#   Signed-off-by: Patrick McHardy <kaber@trash.net>
# 
# net/xfrm/xfrm_state.c
#   2005/04/03 17:36:00+02:00 kaber@coreworks.de +2 -2
#   [IPSEC]: Protect against BHs in xfrm_user_policy()
#   
#   Signed-off-by: Patrick McHardy <kaber@trash.net>
# 
diff -Nru a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
--- a/net/xfrm/xfrm_state.c	2005-04-03 18:04:38 +02:00
+++ b/net/xfrm/xfrm_state.c	2005-04-03 18:04:38 +02:00
@@ -878,14 +878,14 @@
 		goto out;
 
 	err = -EINVAL;
-	read_lock(&xfrm_km_lock);
+	read_lock_bh(&xfrm_km_lock);
 	list_for_each_entry(km, &xfrm_km_list, list) {
 		pol = km->compile_policy(sk->sk_family, optname, data,
 					 optlen, &err);
 		if (err >= 0)
 			break;
 	}
-	read_unlock(&xfrm_km_lock);
+	read_unlock_bh(&xfrm_km_lock);
 
 	if (err >= 0) {
 		xfrm_sk_policy_insert(sk, err, pol);

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

end of thread, other threads:[~2005-04-04 17:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-03 16:13 [IPSEC]: Protect against BHs in xfrm_user_policy() Patrick McHardy
2005-04-04  1:20 ` Herbert Xu
2005-04-04  3:47   ` Patrick McHardy
2005-04-04  4:06     ` Herbert Xu
2005-04-04 11:55   ` Herbert Xu
2005-04-04 17:35     ` David S. 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).