netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] GSO: Reload iph after pskb_may_pull
@ 2016-11-28 15:36 Arnaldo Carvalho de Melo
  2016-11-28 16:34 ` Alexander Duyck
  2016-11-30  1:46 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-11-28 15:36 UTC (permalink / raw)
  To: David Miller
  Cc: Eric Dumazet, Alexander Duyck, Andrey Konovalov,
	Linux Networking Development Mailing List

As it may get stale and lead to use after free.

Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Alexander Duyck <aduyck@mirantis.com>
Cc: Andrey Konovalov <andreyknvl@google.com>
Fixes: cbc53e08a793 ("GSO: Add GSO type for fixed IPv4 ID")
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 net/ipv4/af_inet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index 5ddf5cda07f4..215143246e4b 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -1233,7 +1233,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;
 	}
 
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] GSO: Reload iph after pskb_may_pull
  2016-11-28 15:36 [PATCH 1/1] GSO: Reload iph after pskb_may_pull Arnaldo Carvalho de Melo
@ 2016-11-28 16:34 ` Alexander Duyck
  2016-11-30  1:46 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Alexander Duyck @ 2016-11-28 16:34 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: David Miller, Eric Dumazet, Alexander Duyck, Andrey Konovalov,
	Linux Networking Development Mailing List

On Mon, Nov 28, 2016 at 7:36 AM, Arnaldo Carvalho de Melo
<acme@kernel.org> wrote:
> As it may get stale and lead to use after free.
>
> Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
> Cc: Alexander Duyck <aduyck@mirantis.com>
> Cc: Andrey Konovalov <andreyknvl@google.com>
> Fixes: cbc53e08a793 ("GSO: Add GSO type for fixed IPv4 ID")
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> ---
>  net/ipv4/af_inet.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
> index 5ddf5cda07f4..215143246e4b 100644
> --- a/net/ipv4/af_inet.c
> +++ b/net/ipv4/af_inet.c
> @@ -1233,7 +1233,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;
>         }
>
> --
> 2.9.3
>

Looks good to me.

Acked-by: Alexander Duyck <alexander.h.duyck@intel.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] GSO: Reload iph after pskb_may_pull
  2016-11-28 15:36 [PATCH 1/1] GSO: Reload iph after pskb_may_pull Arnaldo Carvalho de Melo
  2016-11-28 16:34 ` Alexander Duyck
@ 2016-11-30  1:46 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2016-11-30  1:46 UTC (permalink / raw)
  To: acme; +Cc: eric.dumazet, aduyck, andreyknvl, netdev

From: Arnaldo Carvalho de Melo <acme@kernel.org>
Date: Mon, 28 Nov 2016 12:36:58 -0300

> As it may get stale and lead to use after free.
> 
> Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
> Cc: Alexander Duyck <aduyck@mirantis.com>
> Cc: Andrey Konovalov <andreyknvl@google.com>
> Fixes: cbc53e08a793 ("GSO: Add GSO type for fixed IPv4 ID")
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

Applied and queued up for -stable, thanks Arnaldo!

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-11-30  1:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-28 15:36 [PATCH 1/1] GSO: Reload iph after pskb_may_pull Arnaldo Carvalho de Melo
2016-11-28 16:34 ` Alexander Duyck
2016-11-30  1:46 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).