public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 0/9] psp: support rekeying psp protected tcp connections
@ 2026-02-04 15:20 Daniel Zahka
  2026-02-04 15:20 ` [PATCH net-next 1/9] psp: support rx rekey operation Daniel Zahka
                   ` (10 more replies)
  0 siblings, 11 replies; 21+ messages in thread
From: Daniel Zahka @ 2026-02-04 15:20 UTC (permalink / raw)
  To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Simon Horman, Donald Hunter, Boris Pismenny, Saeed Mahameed,
	Leon Romanovsky, Tariq Toukan, Mark Bloch, Andrew Lunn,
	Shuah Khan, Willem de Bruijn
  Cc: netdev, linux-kselftest, Daniel Zahka

The PSP architecture spec specifies the need for rekeying connections
in the event of a device key rotation. After a device key rotation has
occurred, a new rx derived key needs to be generated and sent out to
the other end of the connection sometime before the next device key
rotation occurs.

Because PSP connections involve two different keys at each endpoint,
one for decrypting ingress traffic, and one for encrypting egress
traffic, there are two types of rekeying events that need to be
supported. From the perspective of one endpoint of the connection:

1. rx rekey: we need to allocate a new spi and decryption key on the
current device key to provide to our peer.

2. tx rekey: our peer has provided us with a new spi + encryption key
pair which we should use for encrypting traffic immediately.

In the case of rx rekeying, there is a period where it makes sense to
accept packets authenticated from either the previous or current
spi. To deal with that we allow a socket to keep a chain of a max of
two psp assocs at any time. If authentication state does not match the
most recent assoc, the previous one will be tried.

In the case of tx rekeying, as soon as we install the new tx key, we
have no use for the previous one, and it can be disposed of
immediately. The only catch, is in the case where hw uses a key handle
in tx descriptor state (as opposed to inlining the key directly). If
this is the case, psp core needs to be sure that any of these
unaccounted for references to key state are gone by the time it tries
to sync a deleted key to hw.

To deal with this race condition, the series includes a driver api for
implementing deferred tx key deletion, where the driver can signal
back to the core when it is safe to dispose of old tx keys.

Lastly, some test cases for rekeying are included that go through key
rotations and rekeying.

Signed-off-by: Daniel Zahka <daniel.zahka@gmail.com>
---
Daniel Zahka (9):
      psp: support rx rekey operation
      psp: move code from psp_sock_assoc_set_tx() into helper functions
      psp: support tx rekey operation
      psp: refactor psp_dev_tx_key_del()
      psp: add driver api for deferred tx key deletion
      psp: add core tracked stats for deferred key deletion
      mlx5: psp: implement deferred tx key deletion
      selftests: drv-net: psp: lift psp connection setup out of _data_basic_send() testcase
      selftests: drv-net: psp: add tests for rekeying connections

 Documentation/netlink/specs/psp.yaml               |  14 ++
 .../net/ethernet/mellanox/mlx5/core/en_accel/psp.c | 101 +++++++++-
 .../net/ethernet/mellanox/mlx5/core/en_accel/psp.h |   7 +
 drivers/net/ethernet/mellanox/mlx5/core/en_stats.h |   1 +
 drivers/net/ethernet/mellanox/mlx5/core/en_tx.c    |   1 +
 include/net/psp/functions.h                        |   6 +
 include/net/psp/types.h                            |  39 ++++
 include/uapi/linux/psp.h                           |   2 +
 net/psp/psp.h                                      |   7 +-
 net/psp/psp_main.c                                 | 101 +++++++++-
 net/psp/psp_nl.c                                   |   9 +-
 net/psp/psp_sock.c                                 | 213 +++++++++++++++------
 tools/testing/selftests/drivers/net/psp.py         | 133 ++++++++++++-
 .../testing/selftests/drivers/net/psp_responder.c  | 131 +++++++++++++
 14 files changed, 685 insertions(+), 80 deletions(-)
---
base-commit: 9a9424c756feee9ee6e717405a9d6fa7bacdef08
change-id: 20260202-psp-3c8e2f65c5c4

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


^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2026-02-07  4:32 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-04 15:20 [PATCH net-next 0/9] psp: support rekeying psp protected tcp connections Daniel Zahka
2026-02-04 15:20 ` [PATCH net-next 1/9] psp: support rx rekey operation Daniel Zahka
2026-02-07  4:24   ` Jakub Kicinski
2026-02-07  4:32   ` [net-next,1/9] " Jakub Kicinski
2026-02-04 15:20 ` [PATCH net-next 2/9] psp: move code from psp_sock_assoc_set_tx() into helper functions Daniel Zahka
2026-02-04 20:46   ` Willem de Bruijn
2026-02-04 15:20 ` [PATCH net-next 3/9] psp: support tx rekey operation Daniel Zahka
2026-02-04 15:20 ` [PATCH net-next 4/9] psp: refactor psp_dev_tx_key_del() Daniel Zahka
2026-02-04 20:46   ` Willem de Bruijn
2026-02-04 15:20 ` [PATCH net-next 5/9] psp: add driver api for deferred tx key deletion Daniel Zahka
2026-02-04 15:20 ` [PATCH net-next 6/9] psp: add core tracked stats for deferred " Daniel Zahka
2026-02-04 15:20 ` [PATCH net-next 7/9] mlx5: psp: implement deferred tx " Daniel Zahka
2026-02-07  4:30   ` Jakub Kicinski
2026-02-07  4:32   ` [net-next,7/9] " Jakub Kicinski
2026-02-04 15:20 ` [PATCH net-next 8/9] selftests: drv-net: psp: lift psp connection setup out of _data_basic_send() testcase Daniel Zahka
2026-02-04 20:49   ` Willem de Bruijn
2026-02-04 15:20 ` [PATCH net-next 9/9] selftests: drv-net: psp: add tests for rekeying connections Daniel Zahka
2026-02-04 20:45 ` [PATCH net-next 0/9] psp: support rekeying psp protected tcp connections Willem de Bruijn
2026-02-04 21:43   ` Daniel Zahka
2026-02-07  4:18     ` Jakub Kicinski
2026-02-07  4:21 ` Jakub Kicinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox