From: William Tu Date: Fri, 9 Mar 2018 15:34:42 +0000 (-0800) Subject: ip6erspan: make sure enough headroom at xmit. X-Git-Tag: v4.16-rc7~23^2~61^2 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=e41c7c68ea771683cae5a7f81c268f38d7912ecb;p=uclinux-h8%2Flinux.git ip6erspan: make sure enough headroom at xmit. The patch adds skb_cow_header() to ensure enough headroom at ip6erspan_tunnel_xmit before pushing the erspan header to the skb. Signed-off-by: William Tu Signed-off-by: David S. Miller --- diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c index a299f5424e16..1bbd0930063e 100644 --- a/net/ipv6/ip6_gre.c +++ b/net/ipv6/ip6_gre.c @@ -903,6 +903,9 @@ static netdev_tx_t ip6erspan_tunnel_xmit(struct sk_buff *skb, truncate = true; } + if (skb_cow_head(skb, dev->needed_headroom)) + goto tx_err; + t->parms.o_flags &= ~TUNNEL_KEY; IPCB(skb)->flags = 0;