diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-10-19 14:41:57 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-10-19 14:41:57 -0400 |
commit | e25b492741373542fb593477547fcf7a6b7d8b04 (patch) | |
tree | 783f0607cf3d962f443f2f27e47e4c194427d595 /net/ipv6 | |
parent | 52d589a01d4545ce1dc5c3892bb8c7b55edfe714 (diff) | |
parent | 228b16cb13dfa2f77354a9b144a07e86e2dda01c (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller:
"A quick batch of bug fixes:
1) Fix build with IPV6 disabled, from Eric Dumazet.
2) Several more cases of caching SKB data pointers across calls to
pskb_may_pull(), thus referencing potentially free'd memory. From
Li RongQing.
3) DSA phy code tests operation presence improperly, instead of going:
if (x->ops->foo)
r = x->ops->foo(args);
it was going:
if (x->ops->foo(args))
r = x->ops->foo(args);
Fix from Andew Lunn"
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net:
Net: DSA: Fix checking for get_phy_flags function
ipv6: fix a potential use after free in sit.c
ipv6: fix a potential use after free in ip6_offload.c
ipv4: fix a potential use after free in gre_offload.c
tcp: fix build error if IPv6 is not enabled
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/ip6_offload.c | 1 | ||||
-rw-r--r-- | net/ipv6/sit.c | 6 |
2 files changed, 4 insertions, 3 deletions
diff --git a/net/ipv6/ip6_offload.c b/net/ipv6/ip6_offload.c index 9034f76ae013..91014d32488d 100644 --- a/net/ipv6/ip6_offload.c +++ b/net/ipv6/ip6_offload.c | |||
@@ -46,6 +46,7 @@ static int ipv6_gso_pull_exthdrs(struct sk_buff *skb, int proto) | |||
46 | if (unlikely(!pskb_may_pull(skb, len))) | 46 | if (unlikely(!pskb_may_pull(skb, len))) |
47 | break; | 47 | break; |
48 | 48 | ||
49 | opth = (void *)skb->data; | ||
49 | proto = opth->nexthdr; | 50 | proto = opth->nexthdr; |
50 | __skb_pull(skb, len); | 51 | __skb_pull(skb, len); |
51 | } | 52 | } |
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c index 6eab37cf5345..58e5b4710127 100644 --- a/net/ipv6/sit.c +++ b/net/ipv6/sit.c | |||
@@ -485,11 +485,11 @@ static void ipip6_tunnel_uninit(struct net_device *dev) | |||
485 | */ | 485 | */ |
486 | static int ipip6_err_gen_icmpv6_unreach(struct sk_buff *skb) | 486 | static int ipip6_err_gen_icmpv6_unreach(struct sk_buff *skb) |
487 | { | 487 | { |
488 | const struct iphdr *iph = (const struct iphdr *) skb->data; | 488 | int ihl = ((const struct iphdr *)skb->data)->ihl*4; |
489 | struct rt6_info *rt; | 489 | struct rt6_info *rt; |
490 | struct sk_buff *skb2; | 490 | struct sk_buff *skb2; |
491 | 491 | ||
492 | if (!pskb_may_pull(skb, iph->ihl * 4 + sizeof(struct ipv6hdr) + 8)) | 492 | if (!pskb_may_pull(skb, ihl + sizeof(struct ipv6hdr) + 8)) |
493 | return 1; | 493 | return 1; |
494 | 494 | ||
495 | skb2 = skb_clone(skb, GFP_ATOMIC); | 495 | skb2 = skb_clone(skb, GFP_ATOMIC); |
@@ -498,7 +498,7 @@ static int ipip6_err_gen_icmpv6_unreach(struct sk_buff *skb) | |||
498 | return 1; | 498 | return 1; |
499 | 499 | ||
500 | skb_dst_drop(skb2); | 500 | skb_dst_drop(skb2); |
501 | skb_pull(skb2, iph->ihl * 4); | 501 | skb_pull(skb2, ihl); |
502 | skb_reset_network_header(skb2); | 502 | skb_reset_network_header(skb2); |
503 | 503 | ||
504 | rt = rt6_lookup(dev_net(skb->dev), &ipv6_hdr(skb2)->saddr, NULL, 0, 0); | 504 | rt = rt6_lookup(dev_net(skb->dev), &ipv6_hdr(skb2)->saddr, NULL, 0, 0); |