This is a note to let you know that I've just added the patch titled net: tls: fix device-offloaded sendpage straddling records to the 6.2-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: net-tls-fix-device-offloaded-sendpage-straddling-rec.patch and it can be found in the queue-6.2 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit a674c1be4745625cdc42d5ec446b121116ea0a90 Author: Jakub Kicinski <kuba@xxxxxxxxxx> Date: Sat Mar 4 11:26:10 2023 -0800 net: tls: fix device-offloaded sendpage straddling records [ Upstream commit e539a105f947b9db470fec39fe91d85fe737a432 ] 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@xxxxxxxxxxxx> Link: https://lore.kernel.org/all/61481278.42813558.1677845235112.JavaMail.zimbra@xxxxxxxxxxxx Fixes: c1318b39c7d3 ("tls: Add opt-in zerocopy mode of sendfile()") Tested-by: Adrien Moulin <amoulin@xxxxxxxxxxxx> Reviewed-by: Tariq Toukan <tariqt@xxxxxxxxxx> Acked-by: Maxim Mikityanskiy <maxtram95@xxxxxxxxx> Link: https://lore.kernel.org/r/20230304192610.3818098-1-kuba@xxxxxxxxxx Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/net/tls/tls_device.c b/net/tls/tls_device.c index 6c593788dc250..a7cc4f9faac28 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);