aboutsummaryrefslogtreecommitdiffstats
path: root/net/tls/tls_device.c
diff options
context:
space:
mode:
authorJakub Kicinski <[email protected]>2023-03-04 19:26:10 +0000
committerJakub Kicinski <[email protected]>2023-03-06 21:26:16 +0000
commite539a105f947b9db470fec39fe91d85fe737a432 (patch)
treedd8b55e205353a69c97920b750d9f7c7dd4bd782 /net/tls/tls_device.c
parentnet: ethernet: mtk_eth_soc: fix RX data corruption issue (diff)
downloadkernel-e539a105f947b9db470fec39fe91d85fe737a432.tar.gz
kernel-e539a105f947b9db470fec39fe91d85fe737a432.zip
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. Reported-by: Adrien Moulin <[email protected]> Link: https://lore.kernel.org/all/[email protected] Fixes: c1318b39c7d3 ("tls: Add opt-in zerocopy mode of sendfile()") Tested-by: Adrien Moulin <[email protected]> Reviewed-by: Tariq Toukan <[email protected]> Acked-by: Maxim Mikityanskiy <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'net/tls/tls_device.c')
-rw-r--r--net/tls/tls_device.c2
1 files changed, 2 insertions, 0 deletions
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 @@ handle_error:
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);