ip6_tunnel: fix possible use-after-free on xmit
authorHaishuang Yan <yanhaishuang@cmss.chinamobile.com>
Thu, 25 Jul 2019 16:40:17 +0000 (00:40 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 26 Jul 2019 21:17:44 +0000 (14:17 -0700)
commit01f5bffad555f8e22a61f4b1261fe09cf1b96994
treea5131a096a2872bac0fcd888ebfd6c46ee174ed8
parentc5d139697d5d9ecf9c7cd92d7d7838a173508900
ip6_tunnel: fix possible use-after-free on xmit

ip4ip6/ip6ip6 tunnels run iptunnel_handle_offloads on xmit which
can cause a possible use-after-free accessing iph/ipv6h pointer
since the packet will be 'uncloned' running pskb_expand_head if
it is a cloned gso skb.

Fixes: 0e9a709560db ("ip6_tunnel, ip6_gre: fix setting of DSCP on encapsulated packets")
Signed-off-by: Haishuang Yan <yanhaishuang@cmss.chinamobile.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/ip6_tunnel.c