Skip to content

Commit fcf4793

Browse files
Doron Roberts-Kedesdavem330
authored andcommitted
tls: check RCV_SHUTDOWN in tls_wait_data
The current code does not check sk->sk_shutdown & RCV_SHUTDOWN. tls_sw_recvmsg may return a positive value in the case where bytes have already been copied when the socket is shutdown. sk->sk_err has been cleared, causing the tls_wait_data to hang forever on a subsequent invocation. Checking sk->sk_shutdown & RCV_SHUTDOWN, as in tcp_recvmsg, fixes this problem. Fixes: c46234e ("tls: RX path for ktls") Acked-by: Dave Watson <davejwatson@fb.com> Signed-off-by: Doron Roberts-Kedes <doronrk@fb.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent f7a6eb1 commit fcf4793

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎net/tls/tls_sw.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -646,6 +646,9 @@ static struct sk_buff *tls_wait_data(struct sock *sk, int flags,
646646
return NULL;
647647
}
648648

649+
if (sk->sk_shutdown & RCV_SHUTDOWN)
650+
return NULL;
651+
649652
if (sock_flag(sk, SOCK_DONE))
650653
return NULL;
651654

0 commit comments

Comments
 (0)