Re: [PATCH v3 2/8] tls: Factor tls_rx_decrypt_record() helper

Sabrina Dubroca <[email protected]> Mon, 16 Mar 2026 11:20:07 +0100
Newsgroups dev.linux.lists.kernel-tls-handshake,org.kernel.vger.netdev
Message-ID <abfZVw216f_YU-9e@krikkit>
2026-03-11, 21:47:58 -0400, Chuck Lever wrote:
> From: Chuck Lever <[email protected]>
> 
> recvmsg, read_sock, and splice_read each open-code the
> same sequence: zero-initialize the decrypt arguments, call
> tls_rx_one_record(), and abort the connection on failure.
> 
> Extract tls_rx_decrypt_record() so each receive path shares
> a single decrypt-and-abort primitive. Each call site still
> initializes darg.inargs separately, since recvmsg sets zc
> and async between the memset and the decrypt call.

Is there any reason to keep tls_rx_one_record()? You're replacing all
existing callers, and not introducing new users in this series. Seems
like what you want is just move the tls_err_abort() into
tls_rx_one_record().

(I'm not convinced that "abort the connection on every error (decrypt
fail or ENOMEM or whatever)" is right, but that's a separate question)

-- 
Sabrina