[PATCH net-next v5 4/6] tls: update the RX key when a KeyUpdate is received
Hannes Reinecke
hare at suse.de
Tue Nov 3 23:42:49 PST 2026
On 11/3/26 10:43 PM, Martin Belanger via B4 Relay wrote:
> From: Martin Belanger <martin.belanger at dell.com>
>
> When a KeyUpdate arrives, kTLS blocks reads with -EKEYEXPIRED until
> the user installs the next key. A kernel user such as nvme-tcp or
> sunrpc never does, so the connection stalls.
>
> For a socket with a registered RX secret, derive the next key and
> install it when the KeyUpdate is decrypted. The record is not passed to
> the user, so recvmsg(), splice() and read_sock() go on to the next
> record. Without a registered secret the behavior is unchanged.
>
> A KeyUpdate that is not alone in its record, has a wrong length or an
> invalid request_update value ends the connection, as RFC 9846 section
> 4.7.3 requires. So does a peer that sends more than 8 KeyUpdates in one
> second, the same limit as GnuTLS. That case is counted as
> TlsRxRekeyError and logged, rate limited.
>
> Reviewed-by: Chuck Lever <cel at kernel.org>
> Signed-off-by: Martin Belanger <martin.belanger at dell.com>
> ---
> include/net/tls.h | 7 +++
> net/tls/Makefile | 3 +-
> net/tls/tls.h | 2 +
> net/tls/tls_keyupdate.c | 155 ++++++++++++++++++++++++++++++++++++++++++++++++
> net/tls/tls_sw.c | 38 +++++++++++-
> 5 files changed, 201 insertions(+), 4 deletions(-)
>
Reviewed-by: Hannes Reinecke <hare at kernel.org>
Cheerx,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare at suse.de +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich
More information about the Linux-nvme
mailing list