linux/net/psp
Eric Dumazet b640188b61 psp: use sk->sk_hash in psp_write_headers()
[ Upstream commit f891007ab1 ]

udp_flow_src_port() is indirectly using sk->sk_txhash as a base,
because __tcp_transmit_skb() uses skb_set_hash_from_sk().

This is problematic because this field can change over the
lifetime of a TCP flow, thanks to calls to sk_rethink_txhash().

Problem is that some NIC might (ab)use the PSP UDP source port in their
RSS computation, and PSP packets for a given flow could jump
from one queue to another.

In order to avoid surprises, it is safer to let Protective Load
Balancing (PLB) get its entropy from the IPv6 flowlabel,
and change psp_write_headers() to use sk->sk_hash which
does not change for the duration of the flow.

We might add a sysctl to select the behavior, if there
is a need for it.

Fixes: fc72451574 ("psp: provide encapsulation helper for drivers")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-By: Daniel Zahka <daniel.zahka@gmail.com>
Link: https://patch.msgid.link/20260218141337.999945-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2026-03-04 07:20:44 -05:00
..
Kconfig net: psp: select CONFIG_SKB_EXTENSIONS 2026-02-26 14:59:39 -08:00
Makefile net: psp: add socket security association code 2025-09-18 12:32:06 +02:00
psp-nl-gen.c net: psp: add socket security association code 2025-09-18 12:32:06 +02:00
psp-nl-gen.h net: psp: add socket security association code 2025-09-18 12:32:06 +02:00
psp.h psp: rename our psp_dev_destroy() 2025-09-18 07:04:25 -07:00
psp_main.c psp: use sk->sk_hash in psp_write_headers() 2026-03-04 07:20:44 -05:00
psp_nl.c psp: track generations of device key 2025-09-18 12:32:06 +02:00
psp_sock.c net: psp: don't assume reply skbs will have a socket 2025-10-03 10:23:50 -07:00