Skip to content

Commit 4bb06b6

Browse files
author
Vasily Gorbik
committed
s390/checksum: Fix csum_partial() without vector facility
Currently csum_partial() calls csum_copy() with copy=false and dst=NULL. On machines without the vector facility, csum_copy() falls back to cksm(dst, ...), causing the checksum to be calculated from address zero instead of the source buffer. The VX implementation already checksums data loaded from src. Make the fallback do the same by passing src to cksm(). Fixes: dcd3e1d ("s390/checksum: provide csum_partial_copy_nocheck()") Reviewed-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
1 parent 7d5c2f6 commit 4bb06b6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

arch/s390/lib/csum-partial.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ static __always_inline __wsum csum_copy(void *dst, const void *src, int len, __w
2323
if (!cpu_has_vx()) {
2424
if (copy)
2525
memcpy(dst, src, len);
26-
return cksm(dst, len, sum);
26+
return cksm(src, len, sum);
2727
}
2828
kernel_fpu_begin(&vxstate, KERNEL_VXR_V16V23);
2929
fpu_vlvgf(16, (__force u32)sum, 1);

0 commit comments

Comments
 (0)