Re: [PATCH net-next v1 09/15] net/sched: add act_psp for psp transport mode
From: Todd Bert Freed
Date: Tue Nov 17 2026 - 17:47:09 EST
> [Severity: Medium]
> Can the METADATA_PSP dst and skb->decrypted get separated after this
> point?
>
> The commit message relies on skb->decrypted as the backstop: "on egress,
> encap sets skb->decrypted, so that sk_validate_xmit_skb() drops the packet
> if it loses the METADATA_PSP dst on the way". The egress to ingress guards
> in mirred and bpf also check only the decrypted bit:
>
> One path where this happens, on a non-PSP netdev's clsact egress:
>
> act_ct (defrag, sets tc_skb_cb(skb)->mru)
> -> psp encap (the reassembled packet is not a fragment, so it is accepted)
> -> mirred egress redirect to the PSP netdev
>
> tcf_dev_queue_xmit()
> sch_frag_xmit_hook()
> sch_fragment()
> ip_do_fragment(net, skb->sk, skb, sch_frag_xmit)
>
> sch_frag_xmit() then puts the original dst back on each fragment:
>
> __skb_dst_copy(skb, data->dst);
>
> As a result, every fragment carries the association but has
> decrypted == 0.
The fragment path is handled by "net: don't fragment decrypted skbs" in the
net series,
https://lore.kernel.org/netdev/20261117203137.804424-4-toddfreed@xxxxxxxx
This causes the skbs to simply be dropped instead of being fragmented.
> Would it make sense to do one or more of the following?
>
> - propagate decrypted in ip_copy_metadata() and ip6_copy_metadata()
Conceptually it makes sense. But because of the fix above, that would be
dead code. Furthermore, they still couldn't be sent. skbs which are to be
encrypted on tx (ktls, psp) need the L4 header, and non-initial fragments
do not have it.
> - also test skb_psp_md() in the mirred/bpf guards and in the cleartext
> backstop
>
> - have decap refuse packets that carry a METADATA_PSP dst
In both cases, these guards would be dead code.There's no way for these
to happen once the fragment path is closed.
-Todd