From: Wilfred Mallawa <wilfred.opensource@gmail.com>
To: Sabrina Dubroca <sd@queasysnail.net>
Cc: netdev@vger.kernel.org, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
"David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>,
Jonathan Corbet <corbet@lwn.net>, Simon Horman <horms@kernel.org>,
John Fastabend <john.fastabend@gmail.com>,
Shuah Khan <shuah@kernel.org>
Subject: Re: [PATCH net-next v7 1/2] net/tls: support setting the maximum payload size
Date: Wed, 22 Oct 2025 09:31:51 +1000 [thread overview]
Message-ID: <ba52cb688c9fd3209feefc5f7927d929190626fc.camel@gmail.com> (raw)
In-Reply-To: <aPeASl1RRAKMmuhC@krikkit>
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.
prev parent reply other threads:[~2025-10-21 23:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-21 9:29 Wilfred Mallawa
2025-10-21 9:29 ` [PATCH net-next v7 2/2] selftests: tls: add tls record_size_limit test Wilfred Mallawa
2025-10-21 11:35 ` [PATCH net-next v7 1/2] net/tls: support setting the maximum payload size Simon Horman
2025-10-21 23:23 ` Wilfred Mallawa
2025-10-21 12:44 ` Sabrina Dubroca
2025-10-21 23:31 ` Wilfred Mallawa [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ba52cb688c9fd3209feefc5f7927d929190626fc.camel@gmail.com \
--to=wilfred.opensource@gmail.com \
--cc=corbet@lwn.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=john.fastabend@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sd@queasysnail.net \
--cc=shuah@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®