Re: [PATCH v2 01/17] psp: add documentation

Willem de Bruijn
2025-06-26T13:58:45Z

Jakub Kicinski wrote:
> On Thu, 26 Jun 2025 07:55:34 -0400 Daniel Zahka wrote:
> > >> +after ``psp-versions-ena`` has been disabled. User may also disable
> > >> +``psp-versions-ena`` while there are active associations, which will
> > >> +break all PSP Rx processing.
> > >> +
> > >> +Drivers are expected to ensure that device key is usable upon init
> > >> +(working keys can be allocated), and that no duplicate keys may be generated
> > >> +(reuse of SPI without key rotation). Drivers may achieve this by rotating
> > >> +keys twice before registering the PSP device.
> > > Since the device returns a { session_key, spi } pair, risk of reuse
> > > is purely in firmware.
>
> I don't think this is a requirement put forward in the spec?
> Specifically if a device wants to allow partitioning of the SPI
> space it may let the host pick the SPI. To me the device allocating
> the SPIs seemed more like a convenience thing that a security feature
> to prevent reuse.

That's fair. AFAIK it is not a requirement.

Allowing the host to request a key for a specific SPI will open up the
risk of requesting the same key multiple times.

The simpler device implementation of only incrementing an internal SPI
counter from 1 until ((1<<31) - 1) and then triggering a rotation
trivially avoids that risk.

But indeed this may complicate partitioning between hosts (or even PFs
and VFs) compared to explicit allocation of an SPI space partition to
each.