Commit 66fd848c authored by Ralf Baechle's avatar Ralf Baechle Committed by James Hogan

MIPS: Fix special case in 64 bit IP checksumming.

For certain arguments such as saddr = 0xc0a8fd60, daddr = 0xc0a8fda1,
len = 80, proto = 17, sum = 0x7eae049d there will be a carry when
folding the intermediate 64 bit checksum to 32 bit but the code doesn't
add the carry back to the one's complement sum, thus an incorrect result
will be generated.
Reported-by: default avatarMark Zhang <bomb.zhang@gmail.com>
Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
Reviewed-by: default avatarJames Hogan <james.hogan@imgtec.com>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarJames Hogan <james.hogan@imgtec.com>
parent 4da3273b
...@@ -186,7 +186,9 @@ static inline __wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr, ...@@ -186,7 +186,9 @@ static inline __wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr,
" daddu %0, %4 \n" " daddu %0, %4 \n"
" dsll32 $1, %0, 0 \n" " dsll32 $1, %0, 0 \n"
" daddu %0, $1 \n" " daddu %0, $1 \n"
" sltu $1, %0, $1 \n"
" dsra32 %0, %0, 0 \n" " dsra32 %0, %0, 0 \n"
" addu %0, $1 \n"
#endif #endif
" .set pop" " .set pop"
: "=r" (sum) : "=r" (sum)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment