[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250904063344.6507fcc6@kernel.org>
Date: Thu, 4 Sep 2025 06:33:44 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Sabrina Dubroca <sd@...asysnail.net>
Cc: Wilfred Mallawa <wilfred.opensource@...il.com>, davem@...emloft.net,
edumazet@...gle.com, pabeni@...hat.com, horms@...nel.org, corbet@....net,
john.fastabend@...il.com, netdev@...r.kernel.org,
linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
alistair.francis@....com, dlemoal@...nel.org, Wilfred Mallawa
<wilfred.mallawa@....com>
Subject: Re: [PATCH v3] net/tls: support maximum record size limit
On Thu, 4 Sep 2025 12:10:48 +0200 Sabrina Dubroca wrote:
> If we set tx_record_size_limit to TLS_MAX_PAYLOAD_SIZE+1, we'll end up
> sending a record with a plaintext of TLS_MAX_PAYLOAD_SIZE+2 bytes
> (TLS_MAX_PAYLOAD_SIZE+1 of payload, then 1B of content_type), and a
> "normal" implementation will reject the record since it's too big
> (ktls does that in net/tls/tls_sw.c:tls_rx_msg_size).
>
> So we should subtract 1 from the userspace-provided value for 1.3, and
> then add it back in getsockopt/tls_get_info.
>
> Or maybe userspace should provide the desired payload limit, instead
> of the raw record_size_limit it got from the extension (ie, do -1 when
> needed before calling the setsockopt). Then we should rename this
> "tx_payload_size_limit" (and adjust the docs) to make it clear it's
> not the raw record_size_limit.
>
> The "tx_payload_size_limit" approach is maybe a little bit simpler
> (not having to add/subtract 1 in a few places - I think userspace
> would only have to do it in one place).
>
>
> Wilfred, Jakub, what do you think?
I reckon either way is fine, assuming we clearly document the behavior.
I'd lean slightly to using the same definition of the setsockopt as the
RFC, it may be confusing but if it ever interacts with other settings
it may make it easier to refer to other RFCs.
Powered by blists - more mailing lists