Netdev List
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: toddfreed@meta.com
Cc: netdev@vger.kernel.org, davem@davemloft.net,
	andrew+netdev@lunn.ch, bjorn@kernel.org, borisp@nvidia.com,
	cratiu@nvidia.com, daniel.zahka@gmail.com, dsahern@kernel.org,
	dtatulea@nvidia.com, edumazet@kernel.org, idosch@nvidia.com,
	kuba@kernel.org, john.fastabend@gmail.com, leon@kernel.org,
	linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
	linux-rdma@vger.kernel.org, mbloch@nvidia.com, pabeni@redhat.com,
	raeds@nvidia.com, rrameshbabu@nvidia.com, sd@queasysnail.net,
	saeedm@nvidia.com, shuah@kernel.org, horms@kernel.org,
	tariqt@nvidia.com, weiwan@google.com,
	willemdebruijn.kernel@gmail.com, stable@vger.kernel.org
Subject: Re: [PATCH net v6 3/8] net: don't fragment decrypted skbs
Date: Sat, 21 Nov 2026 21:17:38 +0000	[thread overview]
Message-ID: <179529585831.3135.9494126075737773087@kernel.org> (raw)
In-Reply-To: <20261117203137.804424-4-toddfreed@meta.com>

Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] In ip6_fragment() (net/ipv6/ip6_output.c), the new
  skb_is_decrypted() refusal at lines 932-939 runs before the…

--

net: don't fragment decrypted skbs

This patch makes ip_do_fragment() and ip6_fragment() refuse to fragment
skbs that have skb->decrypted set. Without it, the resulting fragments
can be sent out in cleartext. In ip6_fragment() the new check sits after
the existing too-big checks so that PMTUD for a local socket keeps
working.

[ ... ]

> diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
> index cb648c8394310..5b19683f08e03 100644
> --- a/net/ipv6/ip6_output.c
> +++ b/net/ipv6/ip6_output.c
> @@ -929,6 +929,15 @@ int ip6_fragment(struct net *net, struct sock *sk, struct sk_buff *skb,
>  			mtu = IPV6_MIN_MTU;
>  	}
>  
> +	/* PSP and TLS offload need the packet's L4 header, which non-initial
> +	 * fragments do not have. Checked after the too-big checks above,
> +	 * so that PMTUD for a local socket works.
> +	 */
> +	if (unlikely(skb_is_decrypted(skb))) {
> +		err = -EMSGSIZE;
> +		goto fail;
> +	}
> +
>  	if (np) {
>  		u32 frag_size = READ_ONCE(np->frag_size);

[Severity: Low]
This isn't a bug, but the commit message says:

  in ip6_fragment(), check skb->decrypted after the too-big checks, so
  that a local socket still gets PKT_TOOBIG for path mtu discovery.

ip6_fragment() has one more too-big check after the np->frag_size clamp,
and the new check now runs before it:

	if (mtu < hlen + sizeof(struct frag_hdr) + 8)
		goto fail_toobig;

A decrypted skb that would have reached this check is now dropped with
-EMSGSIZE, and no ICMPV6_PKT_TOOBIG is sent.

At this point mtu is at least IPV6_MIN_MTU. So the bypassed check only
fires with about 1265 bytes or more of unfragmentable extension headers,
and the packet is dropped in either case. The code comment says "the
too-big checks above", which is accurate.

Could the commit message say that the check comes after the ignore_df and
frag_max_size too-big checks, so that it matches the code?

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261117203137.804424-1-toddfreed%40meta.com

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

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-17 20:31 [PATCH net v6 0/8] psp, tls: don't send offloaded contents in cleartext Todd Freed
2026-11-17 20:31 ` [PATCH net v6 1/8] net/mlx5e: ring the tx doorbell when an accel offload drops a packet Todd Freed
2026-11-18 14:08   ` Dragos Tatulea
2026-11-21 21:17   ` netdev-bot+sashiko
2026-11-17 20:31 ` [PATCH net v6 2/8] psp: don't encapsulate ipv6 packets with extension headers Todd Freed
2026-11-17 20:31 ` [PATCH net v6 3/8] net: don't fragment decrypted skbs Todd Freed
2026-11-21 21:17   ` netdev-bot+sashiko [this message]
2026-11-17 20:31 ` [PATCH net v6 4/8] ipv4: icmp: don't quote decrypted payload in icmp errors Todd Freed
2026-11-21 21:17   ` netdev-bot+sashiko
2026-11-17 20:31 ` [PATCH net v6 5/8] ipv6: icmpv6: don't quote decrypted payload in icmpv6 errors Todd Freed
2026-11-21 21:17   ` netdev-bot+sashiko
2026-11-17 20:31 ` [PATCH net v6 6/8] selftests: drv-net: psp: test ipv6 tcp socket with extension headers Todd Freed
2026-11-17 20:31 ` [PATCH net v6 7/8] selftests: drv-net: psp: test that ipv4 psp packets aren't fragmented Todd Freed
2026-11-17 20:31 ` [PATCH net v6 8/8] net/mlx5e: psp: tso: replace only the length in checksum seed Todd Freed
2026-11-18 14:24   ` Dragos Tatulea
2026-11-20 17:17     ` Todd Bert Freed

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=179529585831.3135.9494126075737773087@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=bjorn@kernel.org \
    --cc=borisp@nvidia.com \
    --cc=cratiu@nvidia.com \
    --cc=daniel.zahka@gmail.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=dtatulea@nvidia.com \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=idosch@nvidia.com \
    --cc=john.fastabend@gmail.com \
    --cc=kuba@kernel.org \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=mbloch@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=raeds@nvidia.com \
    --cc=rrameshbabu@nvidia.com \
    --cc=saeedm@nvidia.com \
    --cc=sd@queasysnail.net \
    --cc=shuah@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tariqt@nvidia.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox