Re: [PATCH net-next v5 4/6] tls: update the RX key when a KeyUpdate is received

From
Hannes Reinecke <hare@suse.de>
Date
2026-11-04 07:42:52
Also in
linux-doc, linux-kselftest, linux-nvme, lkml
Reply to
Martin Belanger via B4 Relay, 2026-11-03
On 11/3/26 10:43 PM, Martin Belanger via B4 Relay wrote:
From: Martin Belanger <redacted>

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@kernel.org>
Signed-off-by: Martin Belanger <redacted>
---
  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@kernel.org>

Cheerx,

Hannes
-- 
Dr. Hannes Reinecke                  Kernel Storage Architect
hare@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
Thread (10 messages) 10 messages, 3 authors, last reply 1d ago
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help