From: "Daniel Zahka" <daniel.zahka@gmail.com>
To: "Todd Freed" <toddfreed@meta.com>, <netdev@vger.kernel.org>
Cc: "David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@kernel.org>,
"Jakub Kicinski" <kuba@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>,
"Simon Horman" <horms@kernel.org>,
"Daniel Zahka" <daniel.zahka@gmail.com>,
"Willem de Bruijn" <willemdebruijn.kernel@gmail.com>,
"Wei Wang" <weiwan@google.com>,
"Jamal Hadi Salim" <jhs@mojatatu.com>,
"Jiri Pirko" <jiri@resnulli.us>,
"Alexei Starovoitov" <ast@kernel.org>,
"Daniel Borkmann" <daniel@iogearbox.net>,
"Andrii Nakryiko" <andrii@kernel.org>,
"Martin KaFai Lau" <martin.lau@linux.dev>,
"John Fastabend" <john.fastabend@gmail.com>,
"Stanislav Fomichev" <sdf@fomichev.me>,
"Sabrina Dubroca" <sd@queasysnail.net>,
"Boris Pismenny" <borisp@nvidia.com>, <bpf@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net 3/3] psp: only give time-wait sockets of PSP connections a validator
Date: Mon, 16 Nov 2026 07:41:30 -0500 [thread overview]
Message-ID: <DMWN5R6QVUPN.1KP7SYYHHU71U@gmail.com> (raw)
In-Reply-To: <20261113185553.171059-4-toddfreed@meta.com>
On Fri Nov 13, 2026 at 1:55 PM EST, Todd Freed wrote:
> psp_twsk_init() sets tw_validate_xmit_skb on TCP time-wait sockets.
> Today, that becomes set whether or not the socket has PSP offload, which
> is not needed but is harmless. psp_validate_xmit() passes such packets.
>
> But a validator makes a socket look like it has an encryption offload of
> its own. The tc psp action in the net-next series "psp: introduce
> socket-less associations" relies on the presence of the validator to
> determine whether the socket has an encryption offload.
I don't think this is relevant.
>
> Set the validator only when the socket has a PSP association with a Tx
> key, as psp_sock_set_tx_key() does for full sockets.
>
> Fixes: 6b46ca260e22 ("net: psp: add socket security association code")
> Signed-off-by: Todd Freed <toddfreed@meta.com>
> ---
> net/psp/psp_sock.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/net/psp/psp_sock.c b/net/psp/psp_sock.c
> index a6b1c42dd626..1df65505f1c6 100644
> --- a/net/psp/psp_sock.c
> +++ b/net/psp/psp_sock.c
> @@ -314,10 +314,13 @@ void psp_twsk_init(struct inet_timewait_sock *tw, const struct sock *sk)
> {
> struct psp_assoc *pas = psp_sk_assoc(sk);
>
> - if (pas)
> + if (pas) {
> refcount_inc(&pas->refcnt);
> + /* like the full socket case in psp_sock_set_tx_key() */
I'm not a fan of this kind of comment, but that's my own preference.
> + if (pas->tx.spi)
> + tw->tw_validate_xmit_skb = psp_validate_xmit;
> + }
> rcu_assign_pointer(tw->psp_assoc, pas);
> - tw->tw_validate_xmit_skb = psp_validate_xmit;
> }
>
> void psp_twsk_assoc_free(struct inet_timewait_sock *tw)
Reviewed-by: Daniel Zahka <daniel.zahka@gmail.com>
prev parent reply other threads:[~2026-11-16 12:41 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-13 18:55 [PATCH net 0/3] net: don't redirect decrypted skbs to ingress, psp time-wait validator Todd Freed
2026-11-13 18:55 ` [PATCH net 1/3] net/sched: act_mirred: don't send decrypted skbs from egress to ingress Todd Freed
2026-11-14 12:04 ` Jamal Hadi Salim
2026-11-19 2:27 ` Jakub Kicinski
2026-11-19 19:06 ` Todd Bert Freed
2026-11-13 18:55 ` [PATCH net 2/3] bpf: don't redirect " Todd Freed
2026-11-13 18:55 ` [PATCH net 3/3] psp: only give time-wait sockets of PSP connections a validator Todd Freed
2026-11-16 12:41 ` Daniel Zahka [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DMWN5R6QVUPN.1KP7SYYHHU71U@gmail.com \
--to=daniel.zahka@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=borisp@nvidia.com \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=john.fastabend@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=martin.lau@linux.dev \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sd@queasysnail.net \
--cc=sdf@fomichev.me \
--cc=toddfreed@meta.com \
--cc=weiwan@google.com \
--cc=willemdebruijn.kernel@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.