xfrm_user_policy() is called from ip_setsockopt with enabled
BHs, so it needs to protect against them when grabbing
xfrm_km_lock.
# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
# 2005/04/03 17:36:10+02:00 kaber@xxxxxxxxxxxx
# [IPSEC]: Protect against BHs in xfrm_user_policy()
#
# Signed-off-by: Patrick McHardy <kaber@xxxxxxxxx>
#
# net/xfrm/xfrm_state.c
# 2005/04/03 17:36:00+02:00 kaber@xxxxxxxxxxxx +2 -2
# [IPSEC]: Protect against BHs in xfrm_user_policy()
#
# Signed-off-by: Patrick McHardy <kaber@xxxxxxxxx>
#
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);
|