]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 9 Aug 2019 15:52:30 +0000 (17:52 +0200)
commit1bb2dd37cb878da69b43957804f2925d6ce33d1b
tree598146f32cc112cb775c11e71aeac2fb895f32a9
parentfdcefa46c5c22fdff4960c6bdabf245af667ceaf
ip6_tunnel: fix possible use-after-free on xmit

[ Upstream commit 01f5bffad555f8e22a61f4b1261fe09cf1b96994 ]

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/ipv6/ip6_tunnel.c