netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC v2 0/1] net/tls: add support for limiting the max record size
@ 2025-08-08  7:23 Wilfred Mallawa
  2025-08-08  7:24 ` [RFC v2 1/1] net/tls: allow limiting maximum " Wilfred Mallawa
  0 siblings, 1 reply; 5+ messages in thread
From: Wilfred Mallawa @ 2025-08-08  7:23 UTC (permalink / raw)
  To: chuck.lever, davem, edumazet, kuba, pabeni, donald.hunter, borisp,
	john.fastabend
  Cc: alistair.francis, dlemoal, kernel-tls-handshake, netdev,
	linux-kernel, Wilfred Mallawa

From: Wilfred Mallawa <wilfred.mallawa@wdc.com>

During a handshake, an endpoint may specify a maximum record size limit.
Currently, the kernel defaults to TLS_MAX_PAYLOAD_SIZE (16KB) for the
maximum record size. Meaning that, outgoing records from the kernel
can exceed the negotiated size during a handshake. In such a case,
the TLS endpoint must send a fatal "record_overflow" alert [1], and
thus the record is discarded.

Upcoming Western Digital NVMe-TCP hardware controllers implement TLS
support. For these devices, supporting TLS record size negotiation is
necessary because the maximum TLS record size supported by the controller
is less than the default 16KB currently used by the kernel.

This patch adds support for retrieving the negotiated record size limit
during a handshake, and enforcing it at the TLS layer such that outgoing
records are no larger than the size negotiated. This patch depends on
the respective userspace support in tlshd [2] and GnuTLS [3]. GnuTLS
patches have been merged.

[1] https://www.rfc-editor.org/rfc/rfc8449
[2] https://github.com/oracle/ktls-utils/pull/112
[3] https://gitlab.com/gnutls/gnutls/-/merge_requests/2005

Wilfred Mallawa (1):
  net/tls: allow limiting maximum record size

 Documentation/netlink/specs/handshake.yaml |  3 +++
 include/net/tls.h                          |  2 ++
 include/uapi/linux/handshake.h             |  1 +
 net/handshake/genl.c                       |  5 ++--
 net/handshake/tlshd.c                      | 29 +++++++++++++++++++++-
 net/tls/tls_sw.c                           |  6 ++++-
 6 files changed, 42 insertions(+), 4 deletions(-)

-- 
2.50.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-08-21  6:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-08  7:23 [RFC v2 0/1] net/tls: add support for limiting the max record size Wilfred Mallawa
2025-08-08  7:24 ` [RFC v2 1/1] net/tls: allow limiting maximum " Wilfred Mallawa
2025-08-18  6:31   ` Hannes Reinecke
2025-08-21  6:18     ` Wilfred Mallawa
2025-08-21  6:47       ` Hannes Reinecke

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).