Commit f945e9c3 authored by Julian Anastasov's avatar Julian Anastasov Committed by Hideaki Yoshifuji

[IPV4/IPV6]: Fix use-after-free bugs in tunneling drivers.

parent de3ce7ba
...@@ -816,6 +816,7 @@ static int ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -816,6 +816,7 @@ static int ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
skb_set_owner_w(new_skb, skb->sk); skb_set_owner_w(new_skb, skb->sk);
dev_kfree_skb(skb); dev_kfree_skb(skb);
skb = new_skb; skb = new_skb;
old_iph = skb->nh.iph;
} }
skb->nh.raw = skb_push(skb, gre_hlen); skb->nh.raw = skb_push(skb, gre_hlen);
......
...@@ -616,6 +616,7 @@ static int ipip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -616,6 +616,7 @@ static int ipip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
skb_set_owner_w(new_skb, skb->sk); skb_set_owner_w(new_skb, skb->sk);
dev_kfree_skb(skb); dev_kfree_skb(skb);
skb = new_skb; skb = new_skb;
old_iph = skb->nh.iph;
} }
skb->nh.raw = skb_push(skb, sizeof(struct iphdr)); skb->nh.raw = skb_push(skb, sizeof(struct iphdr));
......
...@@ -550,6 +550,7 @@ static int ipip6_tunnel_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -550,6 +550,7 @@ static int ipip6_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
skb_set_owner_w(new_skb, skb->sk); skb_set_owner_w(new_skb, skb->sk);
dev_kfree_skb(skb); dev_kfree_skb(skb);
skb = new_skb; skb = new_skb;
iph6 = skb->nh.ipv6h;
} }
skb->nh.raw = skb_push(skb, sizeof(struct iphdr)); skb->nh.raw = skb_push(skb, sizeof(struct iphdr));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment