Thread (19 messages) 19 messages, 3 authors, 1d ago

Re: [PATCH net-next v6 2/9] tls: Check for a pending signal after an empty record

flat view

From: Chuck Lever <cel@kernel.org>
Date: 2026-10-23 15:18:39
Also in: linux-kselftest

On Thu, 22 Oct 2026, netdev-bot+sashiko@kernel.org wrote:
[Severity: High]
Does this close the hang for callers that never receive a signal?
The cover letter scopes the count bound to tls_sw_read_sock() and
leaves recvmsg() with the signal test on purpose. I consider
addressing the hang as out of scope.

Two kinds of caller appear to still be held for as long as the records
keep arriving:

  - nonblocking readers (MSG_DONTWAIT or O_NONBLOCK) with no signal
    pending

  - in-kernel callers that do not take signals. One is nfsd threads, via
    svc_tcp_sock_recvmsg()->sock_recvmsg(sock, msg, MSG_DONTWAIT) on
    kTLS sockets (there is no allow_signal() in fs/nfsd/). Another is
    rpciod workers, via xs_read_stream(transport, MSG_DONTWAIT).
Both exit through tls_rx_rec_wait() with -EAGAIN as soon as the
receive queue drains. The hold lasts while the peer delivers
empty records faster than the reader decrypts them, and that is
the behavior these callers have today. This patch narrows it for
the callers that can take a signal and leaves the rest where they
are.

Could the run also be ended for nonblocking readers? One option is to
return -EAGAIN after an empty record. Another is to stop after a bounded
count, as tls_sw_read_sock() does.
An -EAGAIN after every empty record returns a readable socket to
the caller with nothing copied and the next record already queued,
so a poll-driven reader spins on it. A count bound fits read_sock
because a zero return there means no progress, and a work item can
call the consumer back. recvmsg() has no equivalent return for a
blocking reader that has copied nothing. The in-kernel callers hold
the socket lock across the run and cannot take a signal, as the
cover letter states. If a bound for them turns out to be needed,
it can be made as a separate change with its own Fixes: tag.

I'd like to leave this patch as it is.


-- 
Chuck Lever (Come to NFS bake-a-thon! https://nfsv4bat.org)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help