This is a note to let you know that I've just added the patch titled

    ipv4: Constrain UFO fragment sizes to multiples of 8 bytes

to the 3.0-stable tree which can be found at:
    
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     ipv4-constrain-ufo-fragment-sizes-to-multiples-of-8-bytes.patch
and it can be found in the queue-3.0 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <sta...@kernel.org> know about it.


>From b08c1401e8fbcce60be44a623bcf9d04af3ce2e9 Mon Sep 17 00:00:00 2001
From: Bill Sommerfeld <wsommerf...@google.com>
Date: Tue, 19 Jul 2011 15:22:33 +0000
Subject: ipv4: Constrain UFO fragment sizes to multiples of 8 bytes


From: Bill Sommerfeld <wsommerf...@google.com>

[ Upstream commit d9be4f7a6f5a8da3133b832eca41c3591420b1ca ]

Because the ip fragment offset field counts 8-byte chunks, ip
fragments other than the last must contain a multiple of 8 bytes of
payload.  ip_ufo_append_data wasn't respecting this constraint and,
depending on the MTU and ip option sizes, could create malformed
non-final fragments.

Google-Bug-Id: 5009328
Signed-off-by: Bill Sommerfeld <wsommerf...@google.com>
Signed-off-by: David S. Miller <da...@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---
 net/ipv4/ip_output.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -734,7 +734,7 @@ static inline int ip_ufo_append_data(str
                        int getfrag(void *from, char *to, int offset, int len,
                               int odd, struct sk_buff *skb),
                        void *from, int length, int hh_len, int fragheaderlen,
-                       int transhdrlen, int mtu, unsigned int flags)
+                       int transhdrlen, int maxfraglen, unsigned int flags)
 {
        struct sk_buff *skb;
        int err;
@@ -767,7 +767,7 @@ static inline int ip_ufo_append_data(str
                skb->csum = 0;
 
                /* specify the length of each IP datagram fragment */
-               skb_shinfo(skb)->gso_size = mtu - fragheaderlen;
+               skb_shinfo(skb)->gso_size = maxfraglen - fragheaderlen;
                skb_shinfo(skb)->gso_type = SKB_GSO_UDP;
                __skb_queue_tail(queue, skb);
        }
@@ -831,7 +831,7 @@ static int __ip_append_data(struct sock
            (rt->dst.dev->features & NETIF_F_UFO) && !rt->dst.header_len) {
                err = ip_ufo_append_data(sk, queue, getfrag, from, length,
                                         hh_len, fragheaderlen, transhdrlen,
-                                        mtu, flags);
+                                        maxfraglen, flags);
                if (err)
                        goto error;
                return 0;


Patches currently in stable-queue which might be from wsommerf...@google.com are

queue-3.0/ipv4-constrain-ufo-fragment-sizes-to-multiples-of-8-bytes.patch

_______________________________________________
stable mailing list
stable@linux.kernel.org
http://linux.kernel.org/mailman/listinfo/stable

Reply via email to