Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

x86: fix csum_ipv6_magic asm memory clobber

Just like ip_fast_csum, the assembly snippet in csum_ipv6_magic needs a
memory clobber, as it is only passed the address of the buffer, not a
memory reference to the buffer itself.

This caused failures in Hurd's pfinetv4 when we tried to compile it with
gcc-4.3 (bogus checksums).

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Acked-by: "David S. Miller" <davem@davemloft.net>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Samuel Thibault and committed by
Linus Torvalds
392d814d d22a001b

+2 -1
+2 -1
arch/x86/include/asm/checksum_32.h
··· 161 161 "adcl $0, %0 ;\n" 162 162 : "=&r" (sum) 163 163 : "r" (saddr), "r" (daddr), 164 - "r" (htonl(len)), "r" (htonl(proto)), "0" (sum)); 164 + "r" (htonl(len)), "r" (htonl(proto)), "0" (sum) 165 + : "memory"); 165 166 166 167 return csum_fold(sum); 167 168 }