Skip to contentSkip to conversation

ipv6: fix a potential use after free in ip6_offload.c

PATCH Applied [email protected] 3 participants 3 messages Oct 18, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ipv6: fix a potential use after free in ip6_offload.c

From: Li RongQing <[email protected]>

pskb_may_pull() maybe change skb->data and make opth pointer oboslete, so set the opth again

---
 net/ipv6/ip6_offload.c |    1 +
 1 file changed, 1 insertion(+)
net/ipv6/ip6_offload.c +1 -0
index 9034f76..91014d3 100644
@@ -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);
 	}
Signature · 1 line
1.7.10.4
Acked-by on v1 1/1
#1 lore raw
Quoted 15 lines · On Sat, 2014-10-18 at 17:27 +0800, [email protected] wrote:

From: Li RongQing <[email protected]>

pskb_may_pull() maybe change skb->data and make opth pointer oboslete, so set the opth again

---
 net/ipv6/ip6_offload.c |    1 +
 1 file changed, 1 insertion(+)
net/ipv6/ip6_offload.c +0 -0
index 9034f76..91014d3 100644

net/ipv6/ip6_offload.c static int ipv6_gso_pull_exthdrs(struct sk_buff *skb, int proto) · line 52

Quoted 7 lines
net/ipv6/ip6_offload.c +1 -0
@@ -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);
 	}