Re: [PATCH] SUNRPC: wait for in-flight client TLS handshake callback

"Chuck Lever" <[email protected]>
Newsgroups gmane.linux.nfs,gmane.linux.kernel.stable
Message-ID <[email protected]>

On Sun, Aug 9, 2026, at 1:07 PM, Jérémy Jean wrote:
> xs_tls_handshake_sync() gives xs_tls_handshake_done() a reference to the
> lower transport before submitting the handshake request. On timeout or
> signal, the synchronous waiter drops that reference after calling
> tls_handshake_cancel().
>
> handshake_req_cancel() returns false when handshake_complete() has
> already marked the request complete. In that case the completion callback
> can still be running, so dropping the callback-owned reference in the
> waiter can free the lower transport before xs_tls_handshake_done() stores
> xprt_err or drops its own reference.
>
> If cancellation loses to completion, wait until xs_tls_handshake_done()
> signals handshake_done and let the callback release its reference. This
> mirrors the server-side handshake lifetime handling and keeps the timeout
> or signal return value unchanged.
>
> Fixes: 75eb6af7acdf ("SUNRPC: Add a TCP-with-TLS RPC transport class")
> Cc: [email protected]
> Assisted-by: Codex:gpt-5
> Signed-off-by: Jérémy Jean <[email protected]>

Reviewed-by: Chuck Lever <[email protected]>


-- 
Chuck Lever
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.