netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] net: tls: fix device-offloaded sendpage straddling records
@ 2023-03-04 19:26 Jakub Kicinski
  2023-03-04 19:55 ` Adrien Moulin
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Jakub Kicinski @ 2023-03-04 19:26 UTC (permalink / raw)
  To: davem
  Cc: netdev, edumazet, pabeni, Jakub Kicinski, Adrien Moulin, borisp,
	john.fastabend, tariqt, maximmi, maxtram95

Adrien reports that incorrect data is transmitted when a single
page straddles multiple records. We would transmit the same
data in all iterations of the loop.

Reported-by: Adrien Moulin <amoulin@corp.free.fr>
Link: https://lore.kernel.org/all/61481278.42813558.1677845235112.JavaMail.zimbra@corp.free.fr
Fixes: c1318b39c7d3 ("tls: Add opt-in zerocopy mode of sendfile()")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
CC: borisp@nvidia.com
CC: john.fastabend@gmail.com
CC: tariqt@nvidia.com
CC: maximmi@nvidia.com
CC: maxtram95@gmail.com

Adrien, would you mind sending an official Tested-by: tag
in reply to this patch?

Maxim, can I add a .mailmap entry for you? get_maintainers
will complain if I don't CC your @nvidia address :(
---
 net/tls/tls_device.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/tls/tls_device.c b/net/tls/tls_device.c
index 6c593788dc25..a7cc4f9faac2 100644
--- a/net/tls/tls_device.c
+++ b/net/tls/tls_device.c
@@ -508,6 +508,8 @@ static int tls_push_data(struct sock *sk,
 			zc_pfrag.offset = iter_offset.offset;
 			zc_pfrag.size = copy;
 			tls_append_frag(record, &zc_pfrag, copy);
+
+			iter_offset.offset += copy;
 		} else if (copy) {
 			copy = min_t(size_t, copy, pfrag->size - pfrag->offset);
 
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH net] net: tls: fix device-offloaded sendpage straddling records
  2023-03-04 19:26 [PATCH net] net: tls: fix device-offloaded sendpage straddling records Jakub Kicinski
@ 2023-03-04 19:55 ` Adrien Moulin
  2023-03-06  7:19 ` Tariq Toukan
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Adrien Moulin @ 2023-03-04 19:55 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: davem, netdev, edumazet, pabeni, Boris Pismenny, John Fastabend,
	Tariq Toukan, maximmi, maxtram95

> Adrien, would you mind sending an official Tested-by: tag
> in reply to this patch?

Tested-by: Adrien Moulin <amoulin@corp.free.fr>

Thanks,

-- 
Adrien Moulin

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net] net: tls: fix device-offloaded sendpage straddling records
  2023-03-04 19:26 [PATCH net] net: tls: fix device-offloaded sendpage straddling records Jakub Kicinski
  2023-03-04 19:55 ` Adrien Moulin
@ 2023-03-06  7:19 ` Tariq Toukan
  2023-03-06  9:07 ` Maxim Mikityanskiy
  2023-03-06 22:00 ` patchwork-bot+netdevbpf
  3 siblings, 0 replies; 5+ messages in thread
From: Tariq Toukan @ 2023-03-06  7:19 UTC (permalink / raw)
  To: Jakub Kicinski, davem
  Cc: netdev, edumazet, pabeni, Adrien Moulin, borisp, john.fastabend,
	tariqt, maximmi, maxtram95



On 04/03/2023 21:26, Jakub Kicinski wrote:
> Adrien reports that incorrect data is transmitted when a single
> page straddles multiple records. We would transmit the same
> data in all iterations of the loop.
> 
> Reported-by: Adrien Moulin <amoulin@corp.free.fr>
> Link: https://lore.kernel.org/all/61481278.42813558.1677845235112.JavaMail.zimbra@corp.free.fr
> Fixes: c1318b39c7d3 ("tls: Add opt-in zerocopy mode of sendfile()")
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> ---
> CC: borisp@nvidia.com
> CC: john.fastabend@gmail.com
> CC: tariqt@nvidia.com
> CC: maximmi@nvidia.com
> CC: maxtram95@gmail.com
> 

Thanks for handling this.
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net] net: tls: fix device-offloaded sendpage straddling records
  2023-03-04 19:26 [PATCH net] net: tls: fix device-offloaded sendpage straddling records Jakub Kicinski
  2023-03-04 19:55 ` Adrien Moulin
  2023-03-06  7:19 ` Tariq Toukan
@ 2023-03-06  9:07 ` Maxim Mikityanskiy
  2023-03-06 22:00 ` patchwork-bot+netdevbpf
  3 siblings, 0 replies; 5+ messages in thread
From: Maxim Mikityanskiy @ 2023-03-06  9:07 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: davem, netdev, edumazet, pabeni, Adrien Moulin, borisp,
	john.fastabend, tariqt, maximmi

On Sat, Mar 04, 2023 at 11:26:10AM -0800, Jakub Kicinski wrote:
> Adrien reports that incorrect data is transmitted when a single
> page straddles multiple records. We would transmit the same
> data in all iterations of the loop.
> 
> Reported-by: Adrien Moulin <amoulin@corp.free.fr>
> Link: https://lore.kernel.org/all/61481278.42813558.1677845235112.JavaMail.zimbra@corp.free.fr
> Fixes: c1318b39c7d3 ("tls: Add opt-in zerocopy mode of sendfile()")
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> ---

Thanks for the fix, looks good to me.

Acked-by: Maxim Mikityanskiy <maxtram95@gmail.com>

> Maxim, can I add a .mailmap entry for you? get_maintainers
> will complain if I don't CC your @nvidia address :(

Yes please, that would be great. You can also add maximmi@mellanox.com,
in case someone refers to some old commit.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net] net: tls: fix device-offloaded sendpage straddling records
  2023-03-04 19:26 [PATCH net] net: tls: fix device-offloaded sendpage straddling records Jakub Kicinski
                   ` (2 preceding siblings ...)
  2023-03-06  9:07 ` Maxim Mikityanskiy
@ 2023-03-06 22:00 ` patchwork-bot+netdevbpf
  3 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-03-06 22:00 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: davem, netdev, edumazet, pabeni, amoulin, borisp, john.fastabend,
	tariqt, maximmi, maxtram95

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Sat,  4 Mar 2023 11:26:10 -0800 you wrote:
> Adrien reports that incorrect data is transmitted when a single
> page straddles multiple records. We would transmit the same
> data in all iterations of the loop.
> 
> Reported-by: Adrien Moulin <amoulin@corp.free.fr>
> Link: https://lore.kernel.org/all/61481278.42813558.1677845235112.JavaMail.zimbra@corp.free.fr
> Fixes: c1318b39c7d3 ("tls: Add opt-in zerocopy mode of sendfile()")
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> 
> [...]

Here is the summary with links:
  - [net] net: tls: fix device-offloaded sendpage straddling records
    https://git.kernel.org/netdev/net/c/e539a105f947

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-03-06 22:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-04 19:26 [PATCH net] net: tls: fix device-offloaded sendpage straddling records Jakub Kicinski
2023-03-04 19:55 ` Adrien Moulin
2023-03-06  7:19 ` Tariq Toukan
2023-03-06  9:07 ` Maxim Mikityanskiy
2023-03-06 22:00 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).