If strparser encounters an error it reports it on the socket and stops any further processing. TLS RX will currently pick up that error code with sock_error(), and report it to user space once. Subsequent read calls will block indefinitely.
Since the error condition is not cleared and processing is not restarted it seems more correct to keep returning the error rather than sleeping. Signed-off-by: Jakub Kicinski <[email protected]> Reviewed-by: Simon Horman <[email protected]> --- net/tls/tls_sw.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c index de7561d4cfa5..a9ca2dbe0531 100644 --- a/net/tls/tls_sw.c +++ b/net/tls/tls_sw.c @@ -1245,8 +1245,11 @@ static struct sk_buff *tls_wait_data(struct sock *sk, struct sk_psock *psock, DEFINE_WAIT_FUNC(wait, woken_wake_function); while (!(skb = ctx->recv_pkt) && sk_psock_queue_empty(psock)) { - if (sk->sk_err) { - *err = sock_error(sk); + if (unlikely(sk->sk_err)) { + if (ctx->strp.stopped) + *err = -sk->sk_err; + else + *err = sock_error(sk); return NULL; } -- 2.21.0
