mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-04 10:12:16 +09:00
ip_tunnel: Fix a memory corruption in ip_tunnel_xmit
[ Upstream commit3e08f4a72f] We might extend the used aera of a skb beyond the total headroom when we install the ipip header. Fix this by calling skb_cow_head() unconditionally. Bug was introduced with commitc544193214("GRE: Refactor GRE tunneling code.") Cc: Pravin Shelar <pshelar@nicira.com> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
c7bd069613
commit
23d6f8dd1c
@@ -659,13 +659,13 @@ void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev,
|
||||
|
||||
max_headroom = LL_RESERVED_SPACE(tdev) + sizeof(struct iphdr)
|
||||
+ rt->dst.header_len;
|
||||
if (max_headroom > dev->needed_headroom) {
|
||||
if (max_headroom > dev->needed_headroom)
|
||||
dev->needed_headroom = max_headroom;
|
||||
if (skb_cow_head(skb, dev->needed_headroom)) {
|
||||
dev->stats.tx_dropped++;
|
||||
dev_kfree_skb(skb);
|
||||
return;
|
||||
}
|
||||
|
||||
if (skb_cow_head(skb, dev->needed_headroom)) {
|
||||
dev->stats.tx_dropped++;
|
||||
dev_kfree_skb(skb);
|
||||
return;
|
||||
}
|
||||
|
||||
skb_dst_drop(skb);
|
||||
|
||||
Reference in New Issue
Block a user