Thread (11 messages) 11 messages, 4 authors, 2025-09-28

Re: [PATCH v4 1/2] net/tls: support maximum record size limit

From: Sabrina Dubroca <sd@queasysnail.net>
Date: 2025-09-28 21:44:51
Also in: linux-doc, linux-kselftest, lkml

2025-09-25, 23:37:09 +0000, Wilfred Mallawa wrote:
On Thu, 2025-09-25 at 23:29 +0200, Sabrina Dubroca wrote:
quoted
2025-09-25, 05:39:14 +0000, Wilfred Mallawa wrote:
quoted
On Wed, 2025-09-24 at 19:50 +0200, Sabrina Dubroca wrote:
quoted
quoted
@@ -1111,6 +1180,11 @@ static int tls_get_info(struct sock *sk,
struct sk_buff *skb, bool net_admin)
 			goto nla_failure;
 	}
 
+	err = nla_put_u16(skb, TLS_INFO_TX_RECORD_SIZE_LIM,
+			  ctx->tx_record_size_limit);
I'm not sure here: if we do the +1 adjustment we'd be consistent
with
the value reported by getsockopt, but OTOH users may get confused
about seeing a value larger than TLS_MAX_PAYLOAD_SIZE.
Makes sense to keep the behaviour the same as getsockopt() right?
So
add the +1 changes here based on version (same as getsockopt()). In
which case, it should never exceed TLS_MAX_PAYLOAD_SIZE.
The max value for 1.3 is TLS_MAX_PAYLOAD_SIZE+1 (after adjustment),
since it's the max value that will be accepted by setsockopt (after
passing the "value - 1 > TLS_MAX_PAYLOAD_SIZE" check). And it's the
value most users will see since it's the default.
Ah I see what you mean.  In regards to "but OTOH users may get confused
about seeing a value larger than TLS_MAX_PAYLOAD_SIZE.", do you think
it's sufficient to document TLS_MAX_PAYLOAD_SIZE and specify that for
TLS 1.3 this doesn't include the ContentType byte?
I guess it will have to do. Otherwise, unless someone has another
idea, we're back to the discussion on v3 (ie setting the actual
payload size instead of the record limit).

-- 
Sabrina
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help