net: Fix from address in memcpy_to_iter_csum()
authorMichael Lass <bevan@bi-co.net>
Wed, 31 Jan 2024 15:52:20 +0000 (16:52 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 2 Feb 2024 12:21:02 +0000 (12:21 +0000)
While inlining csum_and_memcpy() into memcpy_to_iter_csum(), the from
address passed to csum_partial_copy_nocheck() was accidentally changed.
This causes a regression in applications using UDP, as for example
OpenAFS, causing loss of datagrams.

Fixes: dc32bff195b4 ("iov_iter, net: Fold in csum_and_memcpy()")
Cc: David Howells <dhowells@redhat.com>
Cc: stable@vger.kernel.org
Cc: regressions@lists.linux.dev
Signed-off-by: Michael Lass <bevan@bi-co.net>
Reviewed-by: Jeffrey Altman <jaltman@auristor.com>
Acked-by: David Howells <dhowells@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/datagram.c

index 103d46f..a8b625a 100644 (file)
@@ -751,7 +751,7 @@ size_t memcpy_to_iter_csum(void *iter_to, size_t progress,
                           size_t len, void *from, void *priv2)
 {
        __wsum *csum = priv2;
-       __wsum next = csum_partial_copy_nocheck(from, iter_to, len);
+       __wsum next = csum_partial_copy_nocheck(from + progress, iter_to, len);
 
        *csum = csum_block_add(*csum, next, progress);
        return 0;