public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC net-next 0/3] tls_sw: add tx record zero padding
@ 2026-03-09  5:48 Wilfred Mallawa
  2026-03-09  5:48 ` [RFC net-next 1/3] net/tls_sw: support randomized " Wilfred Mallawa
                   ` (3 more replies)
  0 siblings, 4 replies; 16+ messages in thread
From: Wilfred Mallawa @ 2026-03-09  5:48 UTC (permalink / raw)
  To: John Fastabend, Jakub Kicinski, Sabrina Dubroca, David S . Miller,
	Eric Dumazet, Paolo Abeni, Simon Horman, Jonathan Corbet,
	Shuah Khan
  Cc: netdev, linux-doc, linux-kernel, linux-kselftest,
	Alistair Francis, Damien Le'Moal, Wilfred Mallawa

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

Currently, for TLS 1.3, ktls does not support record zero padding [1].
Record zero padding is used to allow the sender to hide the size of the
traffic patterns from an observer. TLS is susceptible to a variety of traffic
analysis attacks based on observing the length and timing of encrypted
packets [2]. Upcoming Western Digital NVMe-TCP hardware controllers
implement TLS 1.3. Which from a security perspective, can benefit from having
record zero padding enabled to mitigate against traffic analysis attacks [2].

Thus, for TX, this series adds support to adding randomized number of zero
padding bytes to end-of-record (EOR) records that are not full. This
feature is disabled by default and can be enabled by the new
TLS_TX_RANDOM_PAD socket option. TLS_TX_RANDOM_PAD allows users to set an upper
bound for the number of bytes to be used in zero padding, and can be set
back to 0 to disable zero padding altogher. The number of zero padding bytes
to append is determined by the remaining record room and the user specified
upper bound (minimum of the two). That is
rand([0, min(record_room, upper_bound)]).

Also a selftest is added to test the usage of TLS_TX_RANDOM_PAD.
However, it does not test for zero padding bytes as that is stripped in
the ktls RX path. Additional testing done on a linux NVMe Target with
TLS by issuing an FIO workload to the target and asserting that the target
kernel sees and strips the zero padding attached.

[1] https://datatracker.ietf.org/doc/html/rfc8446#section-5.4l
[2] https://datatracker.ietf.org/doc/html/rfc8446#appendix-E.3

Wilfred Mallawa (3):
  net/tls_sw: support randomized zero padding
  net/tls: add randomized zero padding socket option
  selftest: tls: add tls record zero pad test

 Documentation/networking/tls.rst  | 21 +++++++++
 include/net/tls.h                 |  1 +
 include/uapi/linux/tls.h          |  2 +
 net/tls/tls.h                     |  6 ++-
 net/tls/tls_main.c                | 72 +++++++++++++++++++++++++++++++
 net/tls/tls_sw.c                  | 58 ++++++++++++++++++++-----
 tools/testing/selftests/net/tls.c | 45 +++++++++++++++++++
 7 files changed, 194 insertions(+), 11 deletions(-)

-- 
2.53.0


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

end of thread, other threads:[~2026-03-19  1:36 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-09  5:48 [RFC net-next 0/3] tls_sw: add tx record zero padding Wilfred Mallawa
2026-03-09  5:48 ` [RFC net-next 1/3] net/tls_sw: support randomized " Wilfred Mallawa
2026-03-13 13:16   ` Sabrina Dubroca
2026-03-14 14:39     ` Jakub Kicinski
2026-03-17  0:53       ` Wilfred Mallawa
2026-03-17  1:03         ` Jakub Kicinski
2026-03-17  1:21           ` Wilfred Mallawa
2026-03-17  1:30             ` Jakub Kicinski
2026-03-17  1:53               ` Wilfred Mallawa
2026-03-19  1:35                 ` Alistair Francis
2026-03-17  9:19           ` Sabrina Dubroca
2026-03-17  0:20     ` Wilfred Mallawa
2026-03-09  5:48 ` [RFC net-next 2/3] net/tls: add randomized zero padding socket option Wilfred Mallawa
2026-03-09  5:48 ` [RFC net-next 3/3] selftest: tls: add tls record zero pad test Wilfred Mallawa
2026-03-13 12:13 ` [RFC net-next 0/3] tls_sw: add tx record zero padding Sabrina Dubroca
2026-03-17  0:59   ` Wilfred Mallawa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox