Netdev List
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: Jiayuan Chen <jiayuan.chen@linux.dev>, netdev@vger.kernel.org
Cc: John Fastabend <john.fastabend@gmail.com>,
	Jakub Kicinski <kuba@kernel.org>,
	Sabrina Dubroca <sd@queasysnail.net>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Simon Horman <horms@kernel.org>,
	Wilfred Mallawa <wilfred.mallawa@wdc.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net v2] tls: fix the open record check in the max payload size setsockopt
Date: Thu, 3 Sep 2026 11:06:31 +0200	[thread overview]
Message-ID: <2ba43d6b-f521-415e-a4a1-64b313051c88@redhat.com> (raw)
In-Reply-To: <20260901072927.128688-1-jiayuan.chen@linux.dev>

On 9/1/26 9:29 AM, Jiayuan Chen wrote:
> @@ -862,6 +876,7 @@ static int do_tls_setsockopt_tx_payload_len(struct sock *sk, sockptr_t optval,
>  static int do_tls_setsockopt(struct sock *sk, int optname, sockptr_t optval,
>  			     unsigned int optlen)
>  {
> +	struct tls_context *ctx;
>  	int rc = 0;
>  
>  	switch (optname) {
> @@ -881,9 +896,17 @@ static int do_tls_setsockopt(struct sock *sk, int optname, sockptr_t optval,
>  		rc = do_tls_setsockopt_no_pad(sk, optval, optlen);
>  		break;
>  	case TLS_TX_MAX_PAYLOAD_LEN:
> +		/* Take tx_lock like the sendmsg paths do, the socket lock is
> +		 * dropped while a sender waits for memory, with no record open.
> +		 */
> +		ctx = tls_get_ctx(sk);
> +		rc = mutex_lock_interruptible(&ctx->tx_lock);
> +		if (rc)

Why using the interruptible variant? the blocking lock just after will
still ignore signals, and this sockopt will now surprisingly fail if a
signal happens at the wrong time.

/P


  reply	other threads:[~2026-09-03  9:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-01  7:29 [PATCH net v2] tls: fix the open record check in the max payload size setsockopt Jiayuan Chen
2026-09-03  9:06 ` Paolo Abeni [this message]
2026-09-03  9:40   ` Jiayuan Chen

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=2ba43d6b-f521-415e-a4a1-64b313051c88@redhat.com \
    --to=pabeni@redhat.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=jiayuan.chen@linux.dev \
    --cc=john.fastabend@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=sd@queasysnail.net \
    --cc=wilfred.mallawa@wdc.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