mirror of
https://github.com/torvalds/linux.git
synced 2024-11-25 13:41:51 +00:00
ip_gre: fix a possible crash in ipgre_err()
Another fix needed in ipgre_err(), as parse_gre_header() might change
skb->head.
Bug added in commit c544193214
(GRE: Refactor GRE tunneling code.)
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Pravin B Shelar <pshelar@nicira.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
b423e9ae49
commit
96f5a846bd
@ -235,7 +235,7 @@ static void ipgre_err(struct sk_buff *skb, u32 info)
|
||||
*/
|
||||
struct net *net = dev_net(skb->dev);
|
||||
struct ip_tunnel_net *itn;
|
||||
const struct iphdr *iph = (const struct iphdr *)skb->data;
|
||||
const struct iphdr *iph;
|
||||
const int type = icmp_hdr(skb)->type;
|
||||
const int code = icmp_hdr(skb)->code;
|
||||
struct ip_tunnel *t;
|
||||
@ -281,6 +281,7 @@ static void ipgre_err(struct sk_buff *skb, u32 info)
|
||||
else
|
||||
itn = net_generic(net, ipgre_net_id);
|
||||
|
||||
iph = (const struct iphdr *)skb->data;
|
||||
t = ip_tunnel_lookup(itn, skb->dev->ifindex, tpi.flags,
|
||||
iph->daddr, iph->saddr, tpi.key);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user