Skip to contentSkip to conversation

net: Fix from address in memcpy_to_iter_csum()

PATCH Applied Michael Lass 5 participants 6 messages Jan 31, 2024 – Feb 13, 2024

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: Fix from address in memcpy_to_iter_csum()

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 <[email protected]>
---
 net/core/datagram.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/core/datagram.c +1 -1
index 103d46fa0eeb..a8b625abe242 100644
@@ -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;
Signature · 1 line
2.43.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 19 lines · Michael Lass

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<[email protected]>
---
  net/core/datagram.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
net/core/datagram.c +0 -0
index 103d46fa0eeb..a8b625abe242 100644

net/core/datagram.c size_t memcpy_to_iter_csum(void *iter_to, size_t progress, · line 757

Quoted 8 lines
net/core/datagram.c +1 -1
@@ -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;
Acked-by on v1 1/1
#2 lore raw
In reply to Michael Lass
Quoted 10 lines · Michael Lass

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 <[email protected]>
#3 lore raw
In reply to Michael Lass
This patch was applied to netdev/net.git (main) by David S. Miller <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by David S. Miller <[email protected]>:

Quoted 5 lines · On Wed, 31 Jan 2024 16:52:20 +0100 you wrote:

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.

Quoted 7 lines
Fixes dc32bff195b4 ("iov_iter, net: Fold in csum_and_memcpy()")
Cc David Howells <[email protected]>

[...]

Here is the summary with links:
- net: Fix from address in memcpy_to_iter_csum()

    https://git.kernel.org/netdev/net/c/fe92f874f091

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
#4 lore raw

Backport request: commit fe92f874f091 ("net: Fix from address in memcpy_to_iter_csum()")

In reply to Michael Lass

Please backport to stable 6.7 the following patch which was merged upstream as

commit fe92f874f09145a6951deacaa4961390238bbe0d
Author: Michael Lass <[email protected]>
Date:   Wed Jan 31 16:52:20 2024 +0100

    net: Fix from address in memcpy_to_iter_csum()

    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 <[email protected]>

Thank you.

-------- Forwarded Message --------
Subject: [PATCH] net: Fix from address in memcpy_to_iter_csum()
Date: Wed, 31 Jan 2024 16:52:20 +0100
From: Michael Lass <[email protected]>
To: [email protected]
CC: David Howells <[email protected]>, [email protected]

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 <[email protected]>

---
net/core/datagram.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
net/core/datagram.c +0 -0
index 103d46fa0eeb..a8b625abe242 100644
@@ -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;

Signature · 1 line
2.43.0
#5 lore raw

Re: Backport request: commit fe92f874f091 ("net: Fix from address in memcpy_to_iter_csum()")

Quoted 14 lines · Jeffrey E Altman

Please backport to stable 6.7 the following patch which was merged upstream as

commit fe92f874f09145a6951deacaa4961390238bbe0d
Author: Michael Lass <[email protected]>
Date:   Wed Jan 31 16:52:20 2024 +0100

    net: Fix from address in memcpy_to_iter_csum()

    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.

Quoted 9 lines
Fixes dc32bff195b4 ("iov_iter, net: Fold in csum_and_memcpy()")
Cc David Howells <[email protected]>

Now queued up, thanks.

greg k-h