Re: [PATCH net-next v3 04/12] psp: add support for socket-less psp associations

From: Björn Töpel

Date: Thu Nov 26 2026 - 10:08:11 EST


Todd Freed <toddfreed@xxxxxxxx> writes:

> Currently, a PSP association is bound to a TCP socket when it is
> created, and can hold both an Rx and a Tx key.
>
> Add Tx associations which are not bound to a socket, and are referenced
> by an ID, so that other parts of the stack can attach them to packets.
> See the subsequent patches, where the tc psp action does just this.
>
> Socket-less Rx does not need an association, and the kernel does not
> keep anything for this case. For Rx, userspace calls the rx-spi-alloc
> operation, and then uses tc filters that match the corresponding SPI,
> version, and PSP device. The flower matches for these fields are added
> in a subsequent patch.
>
> Add the following new netlink commands. They are admin-only, and
> restricted to the netns of the PSP device.
>
> rx-spi-alloc allocate an Rx SPI and derived key, without a socket.
> The key is delivered to the peer out of band. Also
> returns the number of key rotations of the PSP device
> so far (key-rotations)
> assoc-add create a Tx association and install the peer's key,
> returns its ID
> assoc-del delete a Tx association
> assoc-get get / dump Tx associations; only the SPI is reported
>
> Socket associations are not addressed by these commands, so for example
> assoc-get does not list them.
>
> The kernel doesn't enforce key rotation for socket-less Rx the way it
> does for socket associations. A tc filter which matches a SPI of one
> generation will also match that SPI if subsequently re-used in another
> generation. It is up to userspace to deal with this eventuality by
> removing such rules in time. Userspace may subscribe to rotation
> notifications for this purpose.

Could you talk about the rationale here? rx-spi-alloc returns the key
rotations, why not make the generation part of the flower match?

Probably missing something, but seems like natural for the kernel to
ensure that stale rules wont match reused SPIs?


Björn