All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel Zahka" <daniel.zahka@gmail.com>
To: "Kuniyuki Iwashima" <kuniyu@google.com>,
	"Eric Dumazet" <edumazet@kernel.org>,
	"Neal Cardwell" <ncardwell@google.com>,
	"Daniel Zahka" <daniel.zahka@gmail.com>,
	"Willem de Bruijn" <willemdebruijn.kernel@gmail.com>,
	"David S . Miller" <davem@davemloft.net>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>
Cc: "David Ahern" <dsahern@kernel.org>,
	"Ido Schimmel" <idosch@nvidia.com>,
	"Simon Horman" <horms@kernel.org>,
	"Thaison Phan" <thaisonphan@google.com>,
	"Kuniyuki Iwashima" <kuni1840@gmail.com>,
	<netdev@vger.kernel.org>
Subject: Re: [PATCH v1 net-next 1/2] psp: Check pas->tx.spi in psp_sk_overhead().
Date: Wed, 04 Nov 2026 10:17:31 -0500	[thread overview]
Message-ID: <DMMIYO3E9XF8.3JATGNVBKS9HE@gmail.com> (raw)
In-Reply-To: <20261103000712.658501-2-kuniyu@google.com>

On Mon Nov 2, 2026 at 7:06 PM EST, Kuniyuki Iwashima wrote:
> The next patch moves psp_sk_overhead(sk) from icsk->icsk_ext_hdr_len
> to __tcp_mtu_to_mss() and tcp_mss_to_mtu(), which can be called
> between psp_sock_assoc_set_rx() and psp_sock_set_tx_key() while Tx
> packets are still sent in cleartext.
>
> Currently, psp_sk_overhead() only checks if sk->psp_assoc is set,
> and even without the next patch, if ipv6_update_options() is called
> between psp_sock_assoc_set_rx() and psp_sock_set_tx_key(),
> psp_sk_overhead(sk) is added to icsk->icsk_ext_hdr_len twice.
>
> Let's check pas->tx.spi in psp_sk_overhead().
>
> Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
> ---
> not worth backporting, no one does that, only theoretical issue.
> ---
>  include/net/psp/functions.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/include/net/psp/functions.h b/include/net/psp/functions.h
> index b23c30898389..410adb6718c1 100644
> --- a/include/net/psp/functions.h
> +++ b/include/net/psp/functions.h
> @@ -145,9 +145,9 @@ static inline struct psp_assoc *psp_skb_get_assoc_rcu(struct sk_buff *skb)
>  static inline unsigned int psp_sk_overhead(const struct sock *sk)
>  {
>  	int psp_encap = sizeof(struct udphdr) + PSP_HDR_SIZE + PSP_TRL_SIZE;
> -	bool has_psp = rcu_access_pointer(sk->psp_assoc);
> +	struct psp_assoc *pas = psp_sk_assoc(sk);
>  
> -	return has_psp ? psp_encap : 0;
> +	return pas && pas->tx.spi ? psp_encap : 0;
>  }
>  #else
>  static inline void psp_sk_assoc_free(struct sock *sk) { }

Reviewed-by: Daniel Zahka <daniel.zahka@gmail.com>

  reply	other threads:[~2026-11-04 15:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-03  0:06 [PATCH v1 net-next 0/2] tcp: Let non-PSP and PSP share mtu and advmss Kuniyuki Iwashima
2026-11-03  0:06 ` [PATCH v1 net-next 1/2] psp: Check pas->tx.spi in psp_sk_overhead() Kuniyuki Iwashima
2026-11-04 15:17   ` Daniel Zahka [this message]
2026-11-05  3:57   ` Willem de Bruijn
2026-11-03  0:06 ` [PATCH v1 net-next 2/2] tcp: Subtract psp_sk_overhead() in __tcp_mtu_to_mss() and tcp_mss_to_mtu() Kuniyuki Iwashima
2026-11-04 16:42   ` Daniel Zahka
2026-11-05  3:52   ` Willem de Bruijn
2026-11-06 12:00 ` [PATCH v1 net-next 0/2] tcp: Let non-PSP and PSP share mtu and advmss patchwork-bot+netdevbpf

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=DMMIYO3E9XF8.3JATGNVBKS9HE@gmail.com \
    --to=daniel.zahka@gmail.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=idosch@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=kuni1840@gmail.com \
    --cc=kuniyu@google.com \
    --cc=ncardwell@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=thaisonphan@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.