Thread View: linux.kernel.netdev
3 messages
3 total messages
Started by "Daniel Zahka"
Wed, 21 Oct 2026 22:07
Re: [PATCH net 0/2] psp: drop packets with extension headers in transport mode
Author: "Daniel Zahka"
Date: Wed, 21 Oct 2026 22:07
Date: Wed, 21 Oct 2026 22:07
27 lines
12428 bytes
12428 bytes
On Wed Oct 21, 2026 at 5:01 PM EDT, Todd Freed wrote: > While working on adding support for socket-less psp associations, I > noticed that this case was not being handled correctly. It will be more > relevant with that series, because it adds udp support, for which the > psp nexthdr will be taken from the inner packet. > > Since the tx association encodes intent to send encrypted packets, but > because of other configuration (socket options, routes) the packets are > sent unencrypted, sending this change as a fix. > > The first patch drops the packets, the second patch adds selftests for > that case. > Why not just fix psp_dev_encapsulate() to put the psp headers in the right position? With the self test we are going to make PSP + ipv6 ext header == drop part of the uapi? > Todd Freed (2): > psp: drop transport mode packets with extension headers > selftests: drv-net: psp: test ipv6 tcp socket with extension headers > > net/psp/psp_main.c | 7 +- > tools/testing/selftests/drivers/net/config | 1 + > tools/testing/selftests/drivers/net/psp.py | 120 ++++++++++++++++++++- > 3 files changed, 125 insertions(+), 3 deletions(-)
Re: [PATCH net 0/2] psp: drop packets with extension headers in transport mode
Author: Björn Töpel
Date: Thu, 22 Oct 2026 11:59
Date: Thu, 22 Oct 2026 11:59
41 lines
9528 bytes
9528 bytes
Todd Bert Freed <toddfreed@meta.com> writes: > On Wed, Oct 21, 2026 at 3:07 PM Daniel Zahka <daniel.zahka@gmail.com> wrote: >> > >> > The first patch drops the packets, the second patch adds selftests for >> > that case. >> > >> >> Why not just fix psp_dev_encapsulate() to put the psp headers in the >> right position? With the self test we are going to make PSP + ipv6 ext >> header == drop part of the uapi? > > If the original ipv6 packet has extension headers, then the nexthdr on the > fixed ipv6 header identifies the first extension header, and the L4 proto is > in the nexthdr on the last one in the chain. > > psp_dev_encapsulate() places the udp+psp headers after all the extension > headers in this case. > > The issue is that it rewrites the fixed ipv6 header nexthdr to be UDP, > > ipv6_hdr(skb)->nexthdr = IPPROTO_UDP; > > It would need to walk the chain, and set the nexthdr on the final extension > header to UDP, instead, if the correct policy were for udp+psp to come > after the extension headers in all cases. > > I'm not sure that's the correct policy though ; for some headers (e.g. the > fragment header) it might make sense to leave them on the inner packet. > Note that the psp spec does not describe this. Perhaps the user should > express the desired policy? Fragment extension header would be weird to keep in transport mode... I'd say drop is the right call. Björn
Re: [PATCH net 0/2] psp: drop packets with extension headers in transport mode
Author: "Daniel Zahka"
Date: Thu, 22 Oct 2026 12:06
Date: Thu, 22 Oct 2026 12:06
46 lines
12886 bytes
12886 bytes
On Wed Oct 21, 2026 at 7:16 PM EDT, Todd Bert Freed wrote: > On Wed, Oct 21, 2026 at 3:07 PM Daniel Zahka <daniel.zahka@gmail.com> wrote: >> > >> > The first patch drops the packets, the second patch adds selftests for >> > that case. >> > >> >> Why not just fix psp_dev_encapsulate() to put the psp headers in the >> right position? With the self test we are going to make PSP + ipv6 ext >> header == drop part of the uapi? > > If the original ipv6 packet has extension headers, then the nexthdr on the > fixed ipv6 header identifies the first extension header, and the L4 proto is > in the nexthdr on the last one in the chain. > > psp_dev_encapsulate() places the udp+psp headers after all the extension > headers in this case. > > The issue is that it rewrites the fixed ipv6 header nexthdr to be UDP, > > ipv6_hdr(skb)->nexthdr = IPPROTO_UDP; > > It would need to walk the chain, and set the nexthdr on the final extension > header to UDP, instead, if the correct policy were for udp+psp to come > after the extension headers in all cases. > > I'm not sure that's the correct policy though ; for some headers (e.g. the > fragment header) it might make sense to leave them on the inner packet. > Note that the psp spec does not describe this. Perhaps the user should > express the desired policy? > > Explicitly dropping ipv6 packets with fragments is consistent with the > current behavior (it already doesn't work). > > -Todd I think walking the extension headers and inserting before the transport header is better than dropping. I agree with Bjorn that rejecting fragment header makes sense because the receiver can't decrypt the fragmented PSP payload.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads