[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ba52cb688c9fd3209feefc5f7927d929190626fc.camel@gmail.com>
Date: Wed, 22 Oct 2025 09:31:51 +1000
From: Wilfred Mallawa <wilfred.opensource@...il.com>
To: Sabrina Dubroca <sd@...asysnail.net>
Cc: netdev@...r.kernel.org, linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-kselftest@...r.kernel.org, "David S .
Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, Jakub
Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, Jonathan
Corbet <corbet@....net>, Simon Horman <horms@...nel.org>, John Fastabend
<john.fastabend@...il.com>, Shuah Khan <shuah@...nel.org>
Subject: Re: [PATCH net-next v7 1/2] net/tls: support setting the maximum
payload size
On Tue, 2025-10-21 at 14:44 +0200, Sabrina Dubroca wrote:
> 2025-10-21, 19:29:17 +1000, Wilfred Mallawa wrote:
> > diff --git a/net/tls/tls_main.c b/net/tls/tls_main.c
> > index 39a2ab47fe72..b234d44bd789 100644
> > --- a/net/tls/tls_main.c
> > +++ b/net/tls/tls_main.c
> > @@ -541,6 +541,32 @@ static int do_tls_getsockopt_no_pad(struct
> > sock *sk, char __user *optval,
> > return 0;
> > }
> >
> > +static int do_tls_getsockopt_tx_payload_len(struct sock *sk, char
> > __user *optval,
> > + int __user *optlen)
> > +{
> > + struct tls_context *ctx = tls_get_ctx(sk);
> > + u16 payload_len = ctx->tx_max_payload_len;
> > + int len;
> > +
> > + if (get_user(len, optlen))
> > + return -EFAULT;
> > +
> > + /* For TLS 1.3 payload length includes ContentType */
> > + if (ctx->prot_info.version == TLS_1_3_VERSION)
> > + payload_len++;
>
> I'm not sure why you introduced this compared to v6?
>
> The ContentType isn't really payload (stuff passed to send() by
> userspace), so I think the setsockopt behavior (ignoring the extra
> 1B)
> makes more sense.
>
> Either way, we should really avoid this asymmetry between getsockopt
> and setsockopt. Whatever value is fed through setsockopt should be
> what we get back with getsockopt. Otherwise, the API gets quite
> confusing for users.
>
Ah I see, okay I will revert this change :)
Thanks,
Wilfred
>
> The rest of the patch looks ok.
Powered by blists - more mailing lists