# This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2004/10/18 00:09:08+02:00 kaber@coreworks.de # [XFRM]: Fix invalid optimization in xfrm_policy_check # # By skipping policy checks when the policy list is empty we # allow packets decapsulated by IPsec without a policy and # miss checking against socket policies. # # Signed-off-by: Patrick McHardy # # include/net/xfrm.h # 2004/10/18 00:08:14+02:00 kaber@coreworks.de +1 -1 # [XFRM]: Fix invalid optimization in xfrm_policy_check # # By skipping policy checks when the policy list is empty we # allow packets decapsulated by IPsec without a policy and # miss checking against socket policies. # # Signed-off-by: Patrick McHardy # diff -Nru a/include/net/xfrm.h b/include/net/xfrm.h --- a/include/net/xfrm.h 2004-10-18 00:15:18 +02:00 +++ b/include/net/xfrm.h 2004-10-18 00:15:18 +02:00 @@ -601,7 +601,7 @@ if (sk && sk->sk_policy[XFRM_POLICY_IN]) return __xfrm_policy_check(sk, dir, skb, family); - return !xfrm_policy_list[dir] || + return ((!sk || !sk->sk_policy[dir]) && !xfrm_policy_list[dir] && !skb->sp) || (skb->dst->flags & DST_NOPOLICY) || __xfrm_policy_check(sk, dir, skb, family); }