]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
net: ip_gre: fix possible use-after-free in erspan_rcv
authorLorenzo Bianconi <lorenzo.bianconi@redhat.com>
Sat, 6 Apr 2019 15:16:52 +0000 (17:16 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 8 Apr 2019 23:16:47 +0000 (16:16 -0700)
commit492b67e28ee5f2a2522fb72e3d3bcb990e461514
tree02486e4add5ae9176d978eeacc6463f5c52e9897
parentb75bb8a5b755d0c7bf1ac071e4df2349a7644a1e
net: ip_gre: fix possible use-after-free in erspan_rcv

erspan tunnels run __iptunnel_pull_header on received skbs to remove
gre and erspan headers. This can determine a possible use-after-free
accessing pkt_md pointer in erspan_rcv 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). Fix it resetting pkt_md pointer after
__iptunnel_pull_header

Fixes: 1d7e2ed22f8d ("net: erspan: refactor existing erspan code")
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/ip_gre.c