Skip to contentSkip to conversation

net: tls: fix device-offloaded sendpage straddling records

PATCH Applied Jakub Kicinski 5 participants 5 messages Mar 4, 2023 – Mar 6, 2023

Subsystems (3)
lore
Share & tools
lore

Jakub Kicinski

author maintainer
#0 lore raw

PATCH 1/1 net: tls: fix device-offloaded sendpage straddling records

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.

Fixes c1318b39c7d3 ("tls: Add opt-in zerocopy mode of sendfile()")

---
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]

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(+)
net/tls/tls_device.c +2 -0
index 6c593788dc25..a7cc4f9faac2 100644
@@ -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);
 
Signature · 1 line
2.39.2
Reviewed-by on v1 1/1
#2 lore raw
In reply to Jakub Kicinski
Quoted 8 lines · Jakub Kicinski

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.

Fixes c1318b39c7d3 ("tls: Add opt-in zerocopy mode of sendfile()")
Quoted 7 lines

---
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]

Thanks for handling this.

Acked-by on v1 1/1
#3 lore raw
In reply to Jakub Kicinski
Quoted 9 lines · Jakub Kicinski

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.

Fixes c1318b39c7d3 ("tls: Add opt-in zerocopy mode of sendfile()")

---

Thanks for the fix, looks good to me.

Quoted 2 lines

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 [email protected], in case someone refers to some old commit.

#4 lore raw
In reply to Jakub Kicinski
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:

Hello:

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

Quoted 10 lines · 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.

Fixes c1318b39c7d3 ("tls: Add opt-in zerocopy mode of sendfile()")

[...]

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!

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