Message ID | 20240510030435.120935-1-kuba@kernel.org (mailing list archive) |
---|---|
Headers | show |
Series | add basic PSP encryption for TCP connections | expand |
On 10.05.2024 05:04, Jakub Kicinski wrote: > External email: Use caution opening links or attachments > > > Hi! > > Add support for PSP encryption of TCP connections. > > PSP is a protocol out of Google: > https://github.com/google/psp/blob/main/doc/PSP_Arch_Spec.pdf > which shares some similarities with IPsec. I added some more info > in the first patch so I'll keep it short here. > > The protocol can work in multiple modes including tunneling. > But I'm mostly interested in using it as TLS replacement because > of its superior offload characteristics. Hi! Thank you for doing this. I agree that TLS-like socket support is a main use-case. I'd like to hear what you think on a few other use-cases that I think should be considered as well since it may be difficult to add them as an afterthought: - Tunnel mode. What are your plans for tunnel mode? Clearly it is different from the current approach in some aspects, for example, no sockets will be involved. - RDMA. The ultra ethernet group has mentioned RDMA encryption using PSP. Do you think that RDMA verbs will support PSP in a similar manner to sockets? i.e., using netlink to pass parameters to the device and linking QPs to PSP SAs? - Virtualization. How does PSP work from a VM? is the key shared with the hypervisor or is it private per-VM? and what about containers?
On Wed, 29 May 2024 11:16:12 +0200 Boris Pismenny wrote: > Thank you for doing this. I agree that TLS-like socket support > is a main use-case. I'd like to hear what you think on a few > other use-cases that I think should be considered as well > since it may be difficult to add them as an afterthought: > - Tunnel mode. What are your plans for tunnel mode? Clearly it > is different from the current approach in some aspects, for > example, no sockets will be involved. The drivers should only decap for known L4 protos, I think that's the only catch when we add tunnel support. Otherwise it should be fairly straightforward. Open a UDP socket in the kernel. Get a key + SPI using existing ops. Demux within the UDP socket using SPI. > - RDMA. The ultra ethernet group has mentioned RDMA encryption > using PSP. Do you think that RDMA verbs will support PSP in > a similar manner to sockets? i.e., using netlink to pass > parameters to the device and linking QPs to PSP SAs? > - Virtualization. How does PSP work from a VM? is the key > shared with the hypervisor or is it private per-VM? Depends on the deployment and security model, really, but I'd expect the device key is shared, hypervisor is responsible for rotations, and mediates all key ops from the guests. > and what about containers? I tried to apply some of the lessons learned from TLS offload and made the "PSP device" a separate object. This should make it easy to "forward" the offload to software/container netdevs.
On 29.05.2024 20:50, Jakub Kicinski wrote: > On Wed, 29 May 2024 11:16:12 +0200 Boris Pismenny wrote: >> Thank you for doing this. I agree that TLS-like socket support >> is a main use-case. I'd like to hear what you think on a few >> other use-cases that I think should be considered as well >> since it may be difficult to add them as an afterthought: >> - Tunnel mode. What are your plans for tunnel mode? Clearly it >> is different from the current approach in some aspects, for >> example, no sockets will be involved. > The drivers should only decap for known L4 protos, I think that's > the only catch when we add tunnel support. Otherwise it should be > fairly straightforward. Open a UDP socket in the kernel. Get a key > + SPI using existing ops. Demux within the UDP socket using SPI. IIUC, you refer to tunnel mode as if it offloads encryption alone while keeping headers intact. But, what I had in mind is a fully offloaded tunnel. This is called packet offload mode in IPsec, and with encryption such offloads rely on TC. Note that the main use-case for PSP tunnel mode, unlike transport mode, is carrying VM traffic as indicated by the spec: "The tunnel mode packet format is typically used in virtualized environments.". With virtualization, encap/decap offload is an implicit assumption if not a performance necessity. >> - RDMA. The ultra ethernet group has mentioned RDMA encryption >> using PSP. Do you think that RDMA verbs will support PSP in >> a similar manner to sockets? i.e., using netlink to pass >> parameters to the device and linking QPs to PSP SAs? >> - Virtualization. How does PSP work from a VM? is the key >> shared with the hypervisor or is it private per-VM? > Depends on the deployment and security model, really, but I'd > expect the device key is shared, hypervisor is responsible for > rotations, and mediates all key ops from the guests. I can imagine how this will work, but there are a few issues: - Guests may run out of Tx keys, but they can't initiate key rotation without affecting others. This fate sharing between VMs seems undesirable. - Unclear what sort of mediation is the hypervisor expected to provide: on the one hand, block a key rotation request and the requesting guest is denied service, on the other hand, allow key rotation and a guest may spam these requests to the hypervisor, which will also spam other VMs with notifications of key rotation. > >> and what about containers? > I tried to apply some of the lessons learned from TLS offload and made > the "PSP device" a separate object. This should make it easy to > "forward" the offload to software/container netdevs.
On Wed, 29 May 2024 22:01:52 +0200 Boris Pismenny wrote: > > The drivers should only decap for known L4 protos, I think that's > > the only catch when we add tunnel support. Otherwise it should be > > fairly straightforward. Open a UDP socket in the kernel. Get a key > > + SPI using existing ops. Demux within the UDP socket using SPI. > > IIUC, you refer to tunnel mode as if it offloads > encryption alone while keeping headers intact. But, > what I had in mind is a fully offloaded tunnel. > This is called packet offload mode in IPsec, > and with encryption such offloads rely on TC. Do you see any challenge? > > Depends on the deployment and security model, really, but I'd > > expect the device key is shared, hypervisor is responsible for > > rotations, and mediates all key ops from the guests. > > I can imagine how this will work, but there are a few issues: > - Guests may run out of Tx keys, but they can't initiate key > rotation without affecting others. This fate sharing between > VMs seems undesirable. > - Unclear what sort of mediation is the hypervisor expected > to provide: on the one hand, block a key rotation request and > the requesting guest is denied service, on the other hand, > allow key rotation and a guest may spam these requests to > the hypervisor, which will also spam other VMs with > notifications of key rotation. I don't have much experience working with VMs, or a good understanding of what mlx5 does internally. Without access to the details of even a single device which does PSP - any comment I'd make would be too much of a speculation for my taste :( On the NFP I'm pretty sure we could have given every VM a separate device key, no problem.