Re: [PATCH net-next v3 06/12] net/sched: add act_psp for psp transport mode
From: Todd Bert Freed
Date: Wed Dec 02 2026 - 13:30:13 EST
> [Severity: Medium]
> Can a later action in the same rule move this skb to ingress with
> skb->decrypted still set?
>
> The skb then reaches TCP with decrypted set. On a kTLS socket using
> TLS_HW RX offload:
> ...
> Would the record then count as already decrypted and authenticated by
> the NIC, so software decryption and tag verification are skipped? If so,
> plaintext chosen by whoever controls the tc rule would be accepted as
> genuine TLS record data. That plaintext could be a frame built with
> AF_PACKET or rewritten with pedit.
> ...
> A later patch in the series, Documentation/networking/psp.rst, says such
> a packet is "delivered locally with skb->decrypted still set" and calls
> this unsupported. The kernel still doesn't prevent it, and the document
> doesn't cover the kTLS impact. The code is still the same at the end of
> the series.
>
> Reaching this needs all of the following:
>
> - CAP_NET_ADMIN in the netns.
> - A PSP association that the netns can access.
> - PSP hardware.
> - A kTLS HW RX socket in the same netns.
tl;dr - before this series, if an skb that originated from the network
had skb->decrypted set, then it definitely had been decrypted by the
device.
The new psp encap action sets skb->decrypted on egress, but the skb could
later be redirected to ingress.
Thus, you could now have an skb from the network which traverses
ingress -> egress -> ingress, and is delivered locally with
skb->decrypted set, but which had not, in fact, been decrypted by the
device. I reproduced this with CX7.
Note the previous discussion about egress-to-ingress redirect, here
* https://lore.kernel.org/netdev/20261118182729.21bcf5f5@xxxxxxxxxx
In this case, the concern is not about preventing cleartext leaks onto
the network (it can't cause that), but about preventing local delivery
of unauthenticated data.
I am going to address this by adding a new patch which drops packets
redirected from egress to ingress, by mirred or bpf, when a METADATA_PSP
dst is present.
-Todd
pw-bot: cr