linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 1/1] ipv4: Prevent malformed UFO fragments in ip_append_page
@ 2016-06-13 14:01 Steven Caron
  2016-06-13 15:16 ` Eric Dumazet
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Steven Caron @ 2016-06-13 14:01 UTC (permalink / raw)
  To: Hannes Frederic Sowa, Cong Wang
  Cc: linux-kernel, Linux Kernel Network Developers


As  the ip fragment offset field counts 8-byte chunks, non-final ip
fragments must be multiples of 8 bytes of payload. Depending  on the
mtu and ip option sizes, ip_append_page wasn't respecting this,
notably when running NFS under UDP.

Signed-off-by: Steven Caron <steven.caron@genband.com>
---
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c index 124bf0a..21ec54e 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -1239,7 +1239,7 @@ ssize_t   ip_append_page(struct sock *sk, struct flowi4 *fl4, struct page *page,
                if (skb->ip_summed != CHECKSUM_PARTIAL)
                        return -EOPNOTSUPP;

-               skb_shinfo(skb)->gso_size = mtu - fragheaderlen;
+               skb_shinfo(skb)->gso_size = maxfraglen - fragheaderlen;
                skb_shinfo(skb)->gso_type = SKB_GSO_UDP;
        }
        cork->length += size;

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

* Re: [PATCH v1 1/1] ipv4: Prevent malformed UFO fragments in ip_append_page
  2016-06-13 14:01 [PATCH v1 1/1] ipv4: Prevent malformed UFO fragments in ip_append_page Steven Caron
@ 2016-06-13 15:16 ` Eric Dumazet
  2016-06-13 19:27 ` Hannes Frederic Sowa
  2016-06-15  5:49 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Eric Dumazet @ 2016-06-13 15:16 UTC (permalink / raw)
  To: Steven Caron
  Cc: Hannes Frederic Sowa, Cong Wang, linux-kernel,
	Linux Kernel Network Developers

On Mon, 2016-06-13 at 14:01 +0000, Steven Caron wrote:
> As  the ip fragment offset field counts 8-byte chunks, non-final ip
> fragments must be multiples of 8 bytes of payload. Depending  on the
> mtu and ip option sizes, ip_append_page wasn't respecting this,
> notably when running NFS under UDP.
> 
> Signed-off-by: Steven Caron <steven.caron@genband.com>
> ---

Acked-by: Eric Dumazet <edumazet@google.com>

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

* Re: [PATCH v1 1/1] ipv4: Prevent malformed UFO fragments in ip_append_page
  2016-06-13 14:01 [PATCH v1 1/1] ipv4: Prevent malformed UFO fragments in ip_append_page Steven Caron
  2016-06-13 15:16 ` Eric Dumazet
@ 2016-06-13 19:27 ` Hannes Frederic Sowa
  2016-06-15  5:49 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Hannes Frederic Sowa @ 2016-06-13 19:27 UTC (permalink / raw)
  To: Steven Caron, Cong Wang; +Cc: linux-kernel, Linux Kernel Network Developers

On 13.06.2016 16:01, Steven Caron wrote:
> 
> As  the ip fragment offset field counts 8-byte chunks, non-final ip
> fragments must be multiples of 8 bytes of payload. Depending  on the
> mtu and ip option sizes, ip_append_page wasn't respecting this,
> notably when running NFS under UDP.
> 
> Signed-off-by: Steven Caron <steven.caron@genband.com>

Awesome!

Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>

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

* Re: [PATCH v1 1/1] ipv4: Prevent malformed UFO fragments in ip_append_page
  2016-06-13 14:01 [PATCH v1 1/1] ipv4: Prevent malformed UFO fragments in ip_append_page Steven Caron
  2016-06-13 15:16 ` Eric Dumazet
  2016-06-13 19:27 ` Hannes Frederic Sowa
@ 2016-06-15  5:49 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2016-06-15  5:49 UTC (permalink / raw)
  To: steven.caron; +Cc: hannes, xiyou.wangcong, linux-kernel, netdev

From: Steven Caron <steven.caron@genband.com>
Date: Mon, 13 Jun 2016 14:01:19 +0000

> As  the ip fragment offset field counts 8-byte chunks, non-final ip
> fragments must be multiples of 8 bytes of payload. Depending  on the
> mtu and ip option sizes, ip_append_page wasn't respecting this,
> notably when running NFS under UDP.
> 
> Signed-off-by: Steven Caron <steven.caron@genband.com>

This seems to have DOS newlines or something strange like that.

Please fix your email client to send clean patches.

Thanks.

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

end of thread, other threads:[~2016-06-15  5:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-13 14:01 [PATCH v1 1/1] ipv4: Prevent malformed UFO fragments in ip_append_page Steven Caron
2016-06-13 15:16 ` Eric Dumazet
2016-06-13 19:27 ` Hannes Frederic Sowa
2016-06-15  5:49 ` 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).