From bc8b70fc00348268ed9981437f26cad84d0d681c Mon Sep 17 00:00:00 2001 From: "Paolo \\'Blaisorblade\\' Giarrusso" Date: Wed, 13 Oct 2004 07:31:33 -0700 Subject: [PATCH] [PATCH] uml: fix critical IP checksum corruption From: Lars Ellenberg 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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- arch/um/include/sysdep-i386/checksum.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/um/include/sysdep-i386/checksum.h b/arch/um/include/sysdep-i386/checksum.h index bac91c1b88da3..bb6b343f19c0b 100644 --- a/arch/um/include/sysdep-i386/checksum.h +++ b/arch/um/include/sysdep-i386/checksum.h @@ -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); } -- 2.53.0