Skip to content

Commit 7608a97

Browse files
qsnkuba-moo
authored andcommitted
tls: recv: process_rx_list shouldn't use an offset with kvec
Only MSG_PEEK needs to copy from an offset during the final process_rx_list call, because the bytes we copied at the beginning of tls_sw_recvmsg were left on the rx_list. In the KVEC case, we removed data from the rx_list as we were copying it, so there's no need to use an offset, just like in the normal case. Fixes: 692d7b5 ("tls: Fix recvmsg() to be able to peek across multiple records") Signed-off-by: Sabrina Dubroca <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://lore.kernel.org/r/e5487514f828e0347d2b92ca40002c62b58af73d.1711120964.git.sd@queasysnail.net Signed-off-by: Jakub Kicinski <[email protected]>
1 parent c1fd3a9 commit 7608a97

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/tls/tls_sw.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2152,7 +2152,7 @@ int tls_sw_recvmsg(struct sock *sk,
21522152
}
21532153

21542154
/* Drain records from the rx_list & copy if required */
2155-
if (is_peek || is_kvec)
2155+
if (is_peek)
21562156
err = process_rx_list(ctx, msg, &control, copied + peeked,
21572157
decrypted - peeked, is_peek, NULL);
21582158
else

0 commit comments

Comments
 (0)