Skip to content

Commit

Permalink
tls: recv: process_rx_list shouldn't use an offset with kvec
Browse files Browse the repository at this point in the history
[ Upstream commit 7608a97 ]

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 <sd@queasysnail.net>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://lore.kernel.org/r/e5487514f828e0347d2b92ca40002c62b58af73d.1711120964.git.sd@queasysnail.net
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
qsn authored and gregkh committed Apr 10, 2024
1 parent 872f574 commit dc4bce2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/tls/tls_sw.c
Expand Up @@ -2152,7 +2152,7 @@ int tls_sw_recvmsg(struct sock *sk,
}

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

0 comments on commit dc4bce2

Please sign in to comment.