Netdev List
 help / color / mirror / Atom feed
From: Sabrina Dubroca <sd@queasysnail.net>
To: Felipe Pereira Stival via B4 Relay
	<devnull+v0idpwn.gmail.com@kernel.org>
Cc: John Fastabend <john.fastabend@gmail.com>,
	Jakub Kicinski <kuba@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Randy Dunlap <rdunlap@infradead.org>,
	Shuah Khan <shuah@kernel.org>,
	netdev@vger.kernel.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
	Felipe Pereira Stival <v0idpwn@gmail.com>
Subject: Re: [PATCH net 1/2] tls: don't hide a queued KeyUpdate from poll()
Date: Wed, 25 Nov 2026 17:39:54 +0100	[thread overview]
Message-ID: <awcPWkEtU8rgPAz-@krikkit> (raw)
In-Reply-To: <20261118-v0idpwn-tls-poll-parked-keyupdate-v1-1-8e25101e7be6@gmail.com>

2026-11-18, 17:35:48 -0300, Felipe Pereira Stival via B4 Relay wrote:
> From: Felipe Pereira Stival <v0idpwn@gmail.com>
> 
> When application data and a KeyUpdate are both queued, the recv() for
> the data can also decrypt the KeyUpdate. That makes a rekey pending,
> and the KeyUpdate is left on rx_list because its record type differs.
> tls_sk_poll() reports no read events while a rekey is pending, so the
> socket doesn't poll readable although a recvmsg() would return the
> KeyUpdate. A reader that waits for a read event before each recv()
> never reads it, never provides the new key and receives nothing more.
> 
> Report read events for records on rx_list while a rekey is pending,
> since they are already decrypted. Keep ignoring the records still in
> the strparser, so once the KeyUpdate has been read there are no read
> events until the new key is provided, as before. Update the
> documentation to say so.
> 
> Found with a level-triggered epoll reader that does one recv() per
> read event. Without this patch it gets the data and then no read event
> for the KeyUpdate; with it, the KeyUpdate is reported and the rekey
> completes.
> 
> Fixes: 47069594e67e ("tls: implement rekey for TLS1.3")
> Assisted-by: Claude:claude-fable-5-2
> Signed-off-by: Felipe Pereira Stival <v0idpwn@gmail.com>
> ---
>  Documentation/networking/tls.rst | 7 ++++---
>  net/tls/tls_main.c               | 6 +++---
>  2 files changed, 7 insertions(+), 6 deletions(-)

Reviewed-by: Sabrina Dubroca <sd@queasysnail.net>

-- 
Sabrina

  parent reply	other threads:[~2026-11-25 16:39 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-18 20:35 [PATCH net 0/2] tls: don't hide a queued KeyUpdate from poll() Felipe Pereira Stival via B4 Relay
2026-11-18 20:35 ` [PATCH net 1/2] " Felipe Pereira Stival via B4 Relay
2026-11-22 21:26   ` netdev-bot+sashiko
2026-11-23 11:46     ` Felipe Stival
2026-11-25 12:36       ` Simon Horman
2026-11-25 16:39   ` Sabrina Dubroca [this message]
2026-11-18 20:35 ` [PATCH net 2/2] selftests: tls: add a poll test for a queued KeyUpdate Felipe Pereira Stival via B4 Relay
2026-11-25 12:36   ` Simon Horman
2026-11-25 16:40   ` Sabrina Dubroca

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=awcPWkEtU8rgPAz-@krikkit \
    --to=sd@queasysnail.net \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=devnull+v0idpwn.gmail.com@kernel.org \
    --cc=edumazet@kernel.org \
    --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=rdunlap@infradead.org \
    --cc=shuah@kernel.org \
    --cc=skhan@linuxfoundation.org \
    --cc=v0idpwn@gmail.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