sit: reload iphdr in ipip6_rcv
authorHaishuang Yan <yanhaishuang@cmss.chinamobile.com>
Sun, 4 Jun 2017 06:43:43 +0000 (14:43 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 5 Jun 2017 03:04:31 +0000 (23:04 -0400)
Since iptunnel_pull_header() can call pskb_may_pull(),
we must reload any pointer that was related to skb->head.

Fixes: a09a4c8dd1ec ("tunnels: Remove encapsulation offloads on decap")
Signed-off-by: Haishuang Yan <yanhaishuang@cmss.chinamobile.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/sit.c

index 61e5902f068732b10f734c7937c7539d418820d7..af832e7ce80f82a0e74613e88a0abf1e0db627c0 100644 (file)
@@ -657,6 +657,7 @@ static int ipip6_rcv(struct sk_buff *skb)
                if (iptunnel_pull_header(skb, 0, htons(ETH_P_IPV6),
                    !net_eq(tunnel->net, dev_net(tunnel->dev))))
                        goto out;
+               iph = ip_hdr(skb);
 
                err = IP_ECN_decapsulate(iph, skb);
                if (unlikely(err)) {