🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
2 messages
2 total messages Started by Felipe Pereira Stival via B4 Rel... Wed, 18 Nov 2026 20:35
[PATCH net 0/2] tls: don't hide a queued KeyUpdate from poll()
#18753
Author: Felipe Pereira Stival via B4 Rel...
Date: Wed, 18 Nov 2026 20:35
41 lines
12284 bytes
A kTLS reader that waits for a read event before each recv() can stall
after the peer sends a TLS 1.3 KeyUpdate. I ran into this while testing
a kTLS patch for Erlang/OTP.

Erlang does one recv() per read event, with level-triggered epoll.
When application data is followed by a KeyUpdate, one recv() can
decrypt both records, return the data without an error, and leave the
KeyUpdate queued. Because a rekey is now pending, poll() no longer
reports the socket as readable. Without another read event, the reader
never calls recv() again, never sees the -EIO for the KeyUpdate, and
never provides the new key.

Patch 1 keeps the socket readable until the reader has consumed the
KeyUpdate. As before, poll() doesn't report records after the
KeyUpdate until userspace provides the new key. Patch 2 adds a
selftest, which fails without patch 1.

I worked on this with an AI coding assistant (Claude). It wrote the
first drafts of the code and the commit messages, and I reviewed and
reworked them. I directed the whole process, from tracing the missing
read event to tls_sk_poll() to checking how other kinds of readers
are affected and testing in QEMU/KVM.

Signed-off-by: Felipe Pereira Stival <v0idpwn@gmail.com>
---
Felipe Pereira Stival (2):
      tls: don't hide a queued KeyUpdate from poll()
      selftests: tls: add a poll test for a queued KeyUpdate

 Documentation/networking/tls.rst  |  7 ++++---
 net/tls/tls_main.c                |  6 +++---
 tools/testing/selftests/net/tls.c | 40 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 47 insertions(+), 6 deletions(-)
---
base-commit: 2a324a58a084c5cfd7e5a2f55e0786bee170a4a5
change-id: 20261118-v0idpwn-tls-poll-parked-keyupdate-21792b8cfe6d

Best regards,
--  
Felipe Pereira Stival <v0idpwn@gmail.com>
Re: [PATCH net 0/2] tls: don't hide a queued KeyUpdate from poll()
#23019
Author: patchwork-bot+netdevbpf
Date: Thu, 26 Nov 2026 10:30
31 lines
9218 bytes
Hello:

This series was applied to netdev/net.git (main)
by Paolo Abeni <pabeni@redhat.com>:

On Wed, 18 Nov 2026 17:35:47 -0300 you wrote:
> A kTLS reader that waits for a read event before each recv() can stall
> after the peer sends a TLS 1.3 KeyUpdate. I ran into this while testing
> a kTLS patch for Erlang/OTP.
> 
> Erlang does one recv() per read event, with level-triggered epoll.
> When application data is followed by a KeyUpdate, one recv() can
> decrypt both records, return the data without an error, and leave the
> KeyUpdate queued. Because a rekey is now pending, poll() no longer
> reports the socket as readable. Without another read event, the reader
> never calls recv() again, never sees the -EIO for the KeyUpdate, and
> never provides the new key.
> 
> [...]

Here is the summary with links:
  - [net,1/2] tls: don't hide a queued KeyUpdate from poll()
    https://git.kernel.org/netdev/net/c/285ca329ad4b
  - [net,2/2] selftests: tls: add a poll test for a queued KeyUpdate
    https://git.kernel.org/netdev/net/c/d26b244cdec3

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads