From: Li RongQing <roy.qing.li@gmail.com>
Date: Fri, 17 Oct 2014 06:06:16 +0000 (+0800)
Subject: vxlan: fix a free after use
X-Git-Tag: v3.18-rc1~32^2~13
X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=7a9f526fc3ee49b6034af2f243676ee0a27dcaa8;p=linux.git

vxlan: fix a free after use

pskb_may_pull maybe change skb->data and make eth pointer oboslete,
so eth needs to reload

Fixes: 91269e390d062 ("vxlan: using pskb_may_pull as early as possible")
Cc: Eric Dumazet <edumazet@google.com>
Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
---

diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index 77ab844cd8ae..ca309820d39e 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -1887,6 +1887,7 @@ static netdev_tx_t vxlan_xmit(struct sk_buff *skb, struct net_device *dev)
 				    msg->icmph.icmp6_type == NDISC_NEIGHBOUR_SOLICITATION)
 					return neigh_reduce(dev, skb);
 		}
+		eth = eth_hdr(skb);
 #endif
 	}