Re: [PATCH net v6 3/8] net: don't fragment decrypted skbs
From: netdev-bot+sashiko
Date: Sat Nov 21 2026 - 16:17:59 EST
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