[PATCH net-next 0/4] net: psp: require an established connection for association setup

From: Daniel Zahka

Date: Fri Sep 25 2026 - 21:28:20 EST


This series removes support for using PSP's assoc uapi on TCP sockets
not in established state.

The PSP uapi and connection upgrade described in psp.rst is only fleshed
out for established TCP connections. Installing PSP assoc state on a
listen socket, or closed socket ahead of connect() is possible, but not
something that results in useful outcomes.

With commit 8cc3aef0cb19 ("tcp: Do not allow buggy transitions between
ehash and lhash2.") in place, this series makes it impossible to have
PSP assoc state on a listen socket. It is still possible to have a
closed socket with assoc state that connect() can be used on due to
tcp_disconnect() not clearing PSP state. Patch two updates psp.rst to
discuss what this means for users.

The first patch converts some tests that used TCP_CLOSE sockets for
basic uapi tests with connected sockets, so that the subsequent commit
doesn't break them.

The second patch introduces the actual checks on sk->sk_state during the
rx and tx assoc handlers. The commit message contains my argument for
why removing these "features" is appropriate and doesn't constitute a
fix.

The third patch unwinds commit 1d2929d0850f ("net: psp: do not inherit
the Rx association on clone"), which was introduced to workaround assoc
state not being handled correctly from listen sockets.

The fourth patch has some tests for the new checks introduced.

Signed-off-by: Daniel Zahka <daniel.zahka@xxxxxxxxx>
---
Daniel Zahka (4):
selftests: drv-net: psp: swap closed for connected sockets in assoc tests
net: psp: require an established connection for association setup
net: psp: drop psp assoc clear in sk_clone()
selftests: drv-net: psp: test that assocs require an established socket

Documentation/networking/psp.rst | 13 ++++++
net/core/sock.c | 2 +-
net/psp/psp_sock.c | 12 +++++
tools/testing/selftests/drivers/net/psp.py | 73 +++++++++++++++++++++++++-----
4 files changed, 88 insertions(+), 12 deletions(-)
---
base-commit: 4a0f98a164f7d049f337a1a17579f402707a460e
change-id: 20260916-psp-defeat-a271649be9dc

Best regards,
--
Daniel Zahka <daniel.zahka@xxxxxxxxx>