From: Arnaldo Carvalho de Melo Date: Mon, 28 Nov 2016 15:36:58 +0000 (-0300) Subject: GSO: Reload iph after pskb_may_pull X-Git-Tag: v4.8.14~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=17941a9d6409e03b41d5757b36cb8a273ce082d8;p=thirdparty%2Fkernel%2Fstable.git GSO: Reload iph after pskb_may_pull [ Upstream commit a510887824171ad260cc4a2603396c6247fdd091 ] As it may get stale and lead to use after free. Acked-by: Eric Dumazet Cc: Alexander Duyck Cc: Andrey Konovalov Fixes: cbc53e08a793 ("GSO: Add GSO type for fixed IPv4 ID") Signed-off-by: Arnaldo Carvalho de Melo Acked-by: Alexander Duyck Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c index eebbc0f2baa8d..ed22af67c58a5 100644 --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c @@ -1237,7 +1237,7 @@ struct sk_buff *inet_gso_segment(struct sk_buff *skb, fixedid = !!(skb_shinfo(skb)->gso_type & SKB_GSO_TCP_FIXEDID); /* fixed ID is invalid if DF bit is not set */ - if (fixedid && !(iph->frag_off & htons(IP_DF))) + if (fixedid && !(ip_hdr(skb)->frag_off & htons(IP_DF))) goto out; }