]> git.hungrycats.org Git - linux/commitdiff
[PATCH] uml: fix critical IP checksum corruption
authorPaolo \'Blaisorblade\' Giarrusso <blaisorblade_spam@yahoo.it>
Wed, 13 Oct 2004 14:31:33 +0000 (07:31 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Wed, 13 Oct 2004 14:31:33 +0000 (07:31 -0700)
From: Lars Ellenberg <Lars.Ellenberg@linbit.com>

Add a memory barrier to the assembly checksum code - the code was copied
straight from the i386 one, and the patch resyncs the code with the
original.  I'll check if the original code can be included directly (i.e.
"#include") after 2.6.9.

Without this patch, every 2.6 UML release corrupts the checksum of every
UDP fragmented packet with size >= MTU (verified by various people, we all
agree on this issue; nobody reported "Works fine here").  The corrupted
packets are not accepted, thus blocking any kind of communication with
large-sized UDP packets.

In fact, I've even dissected the UML -> host traffic before and after this
patch with Ethereal - and it always reported an incorrect checksum for
fragmented UDP packets before and always correct after applying the patch.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade_spam@yahoo.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/um/include/sysdep-i386/checksum.h

index bac91c1b88da3d1a4ccd064952cd472f4b92f0c1..bb6b343f19c0b0727f0718e64f1a412339fba2f1 100644 (file)
@@ -103,7 +103,8 @@ static inline unsigned short ip_fast_csum(unsigned char * iph,
           are modified, we must also specify them as outputs, or gcc
           will assume they contain their original values. */
        : "=r" (sum), "=r" (iph), "=r" (ihl)
-       : "1" (iph), "2" (ihl));
+       : "1" (iph), "2" (ihl)
+       : "memory");
        return(sum);
 }