MIPS: Fix special case in 64 bit IP checksumming.
authorRalf Baechle <ralf@linux-mips.org>
Thu, 26 Jan 2017 01:16:47 +0000 (02:16 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 12 Mar 2017 05:37:23 +0000 (06:37 +0100)
commit5636da7aba4d03201c8d1484da38335333704fa1
tree77a38c08589c14b62a6c40b757f0ce59815847f2
parentfaf6aa4b129d2edb80a95a4b61f955fda5a194f4
MIPS: Fix special case in 64 bit IP checksumming.

commit 66fd848cadaa6be974a8c780fbeb328f0af4d3bd 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>
arch/mips/include/asm/checksum.h