Skip to content

Commit c17a803

Browse files
committed
tls: stop recv() if initial process_rx_list gave us non-DATA
jira VULN-131360 cve CVE-2024-58239 commit-author Sabrina Dubroca <sd@queasysnail.net> commit fdfbaec If we have a non-DATA record on the rx_list and another record of the same type still on the queue, we will end up merging them: - process_rx_list copies the non-DATA record - we start the loop and process the first available record since it's of the same type - we break out of the loop since the record was not DATA Just check the record type and jump to the end in case process_rx_list did some work. Fixes: 692d7b5 ("tls: Fix recvmsg() to be able to peek across multiple records") Signed-off-by: Sabrina Dubroca <sd@queasysnail.net> Link: https://lore.kernel.org/r/bd31449e43bd4b6ff546f5c51cf958c31c511deb.1708007371.git.sd@queasysnail.net Signed-off-by: Jakub Kicinski <kuba@kernel.org> (cherry picked from commit fdfbaec) Signed-off-by: Brett Mastbergen <bmastbergen@ciq.com>
1 parent 42a8c5e commit c17a803

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
@@ -1944,7 +1944,7 @@ int tls_sw_recvmsg(struct sock *sk,
19441944
goto end;
19451945

19461946
copied = err;
1947-
if (len <= copied)
1947+
if (len <= copied || (copied && control != TLS_RECORD_TYPE_DATA))
19481948
goto end;
19491949

19501950
target = sock_rcvlowat(sk, flags & MSG_WAITALL, len);

0 commit comments

Comments
 (0)