Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7233b9f33e72ca477034ff5cf901c89efba3a5bc
Commit:     7233b9f33e72ca477034ff5cf901c89efba3a5bc
Parent:     2ba582b782071c038b312ea330d3090a39f3c66a
Author:     Herbert Xu <[EMAIL PROTECTED]>
AuthorDate: Wed Dec 12 18:47:48 2007 -0800
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Jan 28 14:57:41 2008 -0800

    [IPSEC]: Fix reversed ICMP6 policy check
    
    The policy check I added for ICMP on IPv6 is reversed.  This
    patch fixes that.
    
    It also adds an skb->sp check so that unprotected packets that
    fail the policy check do not crash the machine.
    
    Signed-off-by: Herbert Xu <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/ipv4/icmp.c |    2 +-
 net/ipv6/icmp.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
index 3c41a6f..c41f3cc 100644
--- a/net/ipv4/icmp.c
+++ b/net/ipv4/icmp.c
@@ -977,7 +977,7 @@ int icmp_rcv(struct sk_buff *skb)
        struct icmphdr *icmph;
        struct rtable *rt = (struct rtable *)skb->dst;
 
-       if (!xfrm4_policy_check(NULL, XFRM_POLICY_IN, skb) &&
+       if (!xfrm4_policy_check(NULL, XFRM_POLICY_IN, skb) && skb->sp &&
            skb->sp->xvec[skb->sp->len - 1]->props.flags & XFRM_STATE_ICMP) {
                int nh;
 
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c
index c0bea7b..1659d2f 100644
--- a/net/ipv6/icmp.c
+++ b/net/ipv6/icmp.c
@@ -644,7 +644,7 @@ static int icmpv6_rcv(struct sk_buff *skb)
        struct icmp6hdr *hdr;
        int type;
 
-       if (xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb) &&
+       if (!xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb) && skb->sp &&
            skb->sp->xvec[skb->sp->len - 1]->props.flags & XFRM_STATE_ICMP) {
                int nh;
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to