Discussion:
[PATCH] ipv6: fix a potential use after free in ip6_offload.c
r***@gmail.com
2014-10-18 09:27:42 UTC
Permalink
From: Li RongQing <***@gmail.com>

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

Signed-off-by: Li RongQing <***@gmail.com>
---
net/ipv6/ip6_offload.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/net/ipv6/ip6_offload.c b/net/ipv6/ip6_offload.c
index 9034f76..91014d3 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)
if (unlikely(!pskb_may_pull(skb, len)))
break;

+ opth = (void *)skb->data;
proto = opth->nexthdr;
__skb_pull(skb, len);
}
--
1.7.10.4
Eric Dumazet
2014-10-18 15:50:39 UTC
Permalink
Post by r***@gmail.com
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(+)
diff --git a/net/ipv6/ip6_offload.c b/net/ipv6/ip6_offload.c
index 9034f76..91014d3 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)
if (unlikely(!pskb_may_pull(skb, len)))
break;
+ opth = (void *)skb->data;
proto = opth->nexthdr;
__skb_pull(skb, len);
}
Acked-by: Eric Dumazet <***@google.com>
David Miller
2014-10-18 17:07:41 UTC
Permalink
From: ***@gmail.com
Date: Sat, 18 Oct 2014 17:27:42 +0800
Post by r***@gmail.com
pskb_may_pull() maybe change skb->data and make opth pointer oboslete,
so set the opth again
Applied.

Loading...