mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
MIPS: Fix special case in 64 bit IP checksumming.
commit 66fd848cad upstream.
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: Mark Zhang <bomb.zhang@gmail.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Reviewed-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
faf6aa4b12
commit
5636da7aba
@@ -186,7 +186,9 @@ static inline __wsum csum_tcpudp_nofold(__be32 saddr,
|
||||
" daddu %0, %4 \n"
|
||||
" dsll32 $1, %0, 0 \n"
|
||||
" daddu %0, $1 \n"
|
||||
" sltu $1, %0, $1 \n"
|
||||
" dsra32 %0, %0, 0 \n"
|
||||
" addu %0, $1 \n"
|
||||
#endif
|
||||
" .set pop"
|
||||
: "=r" (sum)
|
||||
|
||||
Reference in New Issue
Block a user