Skip to content

Commit e539a10

Browse files
committed
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: c1318b3 ("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]>
1 parent 193250a commit e539a10

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

net/tls/tls_device.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,8 @@ static int tls_push_data(struct sock *sk,
508508
zc_pfrag.offset = iter_offset.offset;
509509
zc_pfrag.size = copy;
510510
tls_append_frag(record, &zc_pfrag, copy);
511+
512+
iter_offset.offset += copy;
511513
} else if (copy) {
512514
copy = min_t(size_t, copy, pfrag->size - pfrag->offset);
513515

0 commit comments

Comments
 (0)