mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Wilfred Mallawa <wilfred.opensource@gmail.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: chuck.lever@oracle.com, kernel-tls-handshake@lists.linux.dev,
	 donald.hunter@gmail.com, edumazet@google.com, horms@kernel.org,
	hare@kernel.org, 	john.fastabend@gmail.com,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
		pabeni@redhat.com, Hannes Reinecke <hare@suse.de>
Subject: Re: [PATCH] net/tls: allow limiting maximum record size
Date: Tue, 02 Sep 2025 13:30:49 +1000	[thread overview]
Message-ID: <76d986e3f304dc199826228e90ad3f68160ba8f3.camel@gmail.com> (raw)
In-Reply-To: <20250901113844.339aa80d@kernel.org>

On Mon, 2025-09-01 at 11:39 -0700, Jakub Kicinski wrote:
> On Mon,  1 Sep 2025 15:36:19 +1000 Wilfred Mallawa wrote:
> > During a handshake, an endpoint may specify a maximum record size
> > limit.
> > Currently, the kernel defaults to TLS_MAX_PAYLOAD_SIZE (16KB) for
> > the
> > maximum record size. Meaning that, the outgoing records from the
> > kernel
> > can exceed a lower size negotiated during the handshake. In such a
> > case,
> > the TLS endpoint must send a fatal "record_overflow" alert [1], and
> > thus the record is discarded.
> > 
> > Upcoming Western Digital NVMe-TCP hardware controllers implement
> > TLS
> > support. For these devices, supporting TLS record size negotiation
> > is
> > necessary because the maximum TLS record size supported by the
> > controller
> > is less than the default 16KB currently used by the kernel.
> > 
> > This patch adds support for retrieving the negotiated record size
> > limit
> > during a handshake, and enforcing it at the TLS layer such that
> > outgoing
> > records are no larger than the size negotiated. This patch depends
> > on
> > the respective userspace support in tlshd [2] and GnuTLS [3].
> 
> I don't get why you are putting this in the handshake handling code.
> Add a TLS setsockopt, why any TLS socket can use, whether the socket 
> is opened by the kernel or user. GnuTLS can call it directly before 
> it returns the socket to kernel ownership.
> 
> I feel like I already commented to this effect. If you don't
> understand
> comments from the maintainers - ask for clarifications.

Hey Jakub,

I don't think I saw your email, apologies! But this makes sense, I have
drafted a V2 using setsockopt(). I will send it out soon. Thanks for
the feedback!

Regards,
Wilfred

      parent reply	other threads:[~2025-09-02  3:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-01  5:36 Wilfred Mallawa
2025-09-01 16:44 ` Simon Horman
2025-09-01 21:46   ` Wilfred Mallawa
2025-09-01 18:39 ` Jakub Kicinski
2025-09-01 18:47   ` Chuck Lever
2025-09-02  3:30   ` 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=76d986e3f304dc199826228e90ad3f68160ba8f3.camel@gmail.com \
    --to=wilfred.opensource@gmail.com \
    --cc=chuck.lever@oracle.com \
    --cc=donald.hunter@gmail.com \
    --cc=edumazet@google.com \
    --cc=hare@kernel.org \
    --cc=hare@suse.de \
    --cc=horms@kernel.org \
    --cc=john.fastabend@gmail.com \
    --cc=kernel-tls-handshake@lists.linux.dev \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /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®