net: fou: do not use guehdr after iptunnel_pull_offloads in gue_udp_recv
authorLorenzo Bianconi <lorenzo.bianconi@redhat.com>
Tue, 9 Apr 2019 09:47:20 +0000 (11:47 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 27 Apr 2019 07:35:34 +0000 (09:35 +0200)
commit8835f1c7d0fb0faf6df93c1715f13b9ef04a9e99
tree72d12341f5f2890dcd0b11fa0b27eee0ca197b93
parentc1e7e01e2edb90678e26f100fae0dc50024d139b
net: fou: do not use guehdr after iptunnel_pull_offloads in gue_udp_recv

[ Upstream commit 988dc4a9a3b66be75b30405a5494faf0dc7cffb6 ]

gue tunnels run iptunnel_pull_offloads on received skbs. This can
determine a possible use-after-free accessing guehdr pointer since
the packet will be 'uncloned' running pskb_expand_head if it is a
cloned gso skb (e.g if the packet has been sent though a veth device)

Fixes: a09a4c8dd1ec ("tunnels: Remove encapsulation offloads on decap")
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/ipv4/fou.c