Skip to content

Commit

Permalink
ipv6: fix a potential use after free in ip6_offload.c
Browse files Browse the repository at this point in the history
pskb_may_pull() maybe change skb->data and make opth pointer oboslete,
so set the opth again

Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Li RongQing authored and David S. Miller committed Oct 18, 2014
1 parent b4e3cef commit fc6fb41
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions net/ipv6/ip6_offload.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ static int ipv6_gso_pull_exthdrs(struct sk_buff *skb, int proto)
if (unlikely(!pskb_may_pull(skb, len)))
break;

opth = (void *)skb->data;
proto = opth->nexthdr;
__skb_pull(skb, len);
}
Expand Down

0 comments on commit fc6fb41

Please sign in to comment.