* [PATCH] ip_gre: fix a possible crash in ipgre_err()
@ 2013-05-18 18:36 Eric Dumazet
2013-05-20 7:19 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Eric Dumazet @ 2013-05-18 18:36 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Pravin B Shelar
From: Eric Dumazet <edumazet@google.com>
Another fix needed in ipgre_err(), as parse_gre_header() might change
skb->head.
Bug added in commit c54419321455 (GRE: Refactor GRE tunneling code.)
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Pravin B Shelar <pshelar@nicira.com>
---
net/ipv4/ip_gre.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index c625e4d..2a83591 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -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);
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ip_gre: fix a possible crash in ipgre_err()
2013-05-18 18:36 [PATCH] ip_gre: fix a possible crash in ipgre_err() Eric Dumazet
@ 2013-05-20 7:19 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2013-05-20 7:19 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev, pshelar
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Sat, 18 May 2013 11:36:03 -0700
> From: Eric Dumazet <edumazet@google.com>
>
> Another fix needed in ipgre_err(), as parse_gre_header() might change
> skb->head.
>
> Bug added in commit c54419321455 (GRE: Refactor GRE tunneling code.)
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
Applied, thanks Eric.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-05-20 7:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-18 18:36 [PATCH] ip_gre: fix a possible crash in ipgre_err() Eric Dumazet
2013-05-20 7:19 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox