[patch 1/1] uml: fix critical IP checksum corruption

From: blaisorblade_spam
Date: Mon Oct 11 2004 - 20:19:30 EST



From: Lars Ellenberg <Lars.Ellenberg@xxxxxxxxxx>

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.

Acked-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade_spam@xxxxxxxx>

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade_spam@xxxxxxxx>
---

linux-2.6.9-current-paolo/arch/um/include/sysdep-i386/checksum.h | 3 ++-
1 files changed, 2 insertions(+), 1 deletion(-)

diff -puN arch/um/include/sysdep-i386/checksum.h~uml-fix-checksum-code arch/um/include/sysdep-i386/checksum.h
--- linux-2.6.9-current/arch/um/include/sysdep-i386/checksum.h~uml-fix-checksum-code 2004-10-12 02:33:40.549763104 +0200
+++ linux-2.6.9-current-paolo/arch/um/include/sysdep-i386/checksum.h 2004-10-12 02:33:40.552762648 +0200
@@ -103,7 +103,8 @@ static inline unsigned short ip_fast_csu
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);
}

_
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/