ipv6: drop frames with attached skb->sk in forwarding
authorHannes Frederic Sowa <hannes@stressinduktion.org>
Thu, 8 Oct 2015 16:19:53 +0000 (18:19 +0200)
committerSasha Levin <sasha.levin@oracle.com>
Mon, 14 Mar 2016 21:03:05 +0000 (17:03 -0400)
[ Upstream commit 9ef2e965e55481a52d6d91ce61977a27836268d3 ]

This is a clone of commit 2ab957492d13b ("ip_forward: Drop frames with
attached skb->sk") for ipv6.

This commit has exactly the same reasons as the above mentioned commit,
namely to prevent panics during netfilter reload or a misconfigured stack.

Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
net/ipv6/ip6_output.c

index 36b9ac48b8fb13badef8450e542b5feecaa7946b..06bf4010d3ed78b6ee39db07010090479a43e303 100644 (file)
@@ -376,6 +376,9 @@ int ip6_forward(struct sk_buff *skb)
        if (skb->pkt_type != PACKET_HOST)
                goto drop;
 
+       if (unlikely(skb->sk))
+               goto drop;
+
        if (skb_warn_if_lro(skb))
                goto drop;