Thread View: linux.kernel.netdev
1 messages
1 total messages
Started by netdev-bot+sashiko
Wed, 04 Nov 2026 00:44
Re: [PATCH net v4 2/7] net: don't fragment decrypted skbs
Author: netdev-bot+sashiko
Date: Wed, 04 Nov 2026 00:44
Date: Wed, 04 Nov 2026 00:44
114 lines
11715 bytes
11715 bytes
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.
Critical: 0 · High: 1 · Medium: 0 · Low: 0
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [High] The patch is titled "net: don't fragment decrypted skbs", but
the check it adds lives only in the IPv4 fragmenter, ip_do_fragment()…
--
net: don't fragment decrypted skbs
This patch makes ip_do_fragment() drop skbs that have skb->decrypted set
and return -EMSGSIZE. Without it, fragments of a kTLS offload or PSP
packet lose the decrypted mark and can be sent unencrypted. The commit
message says IPv6 needs no change, because ip6_fragment() refuses
oversized skbs unless ignore_df is set.
> diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
> index eaa6fabda347e..415bc4d524b58 100644
> --- a/net/ipv4/ip_output.c
> +++ b/net/ipv4/ip_output.c
> @@ -770,6 +770,14 @@ int ip_do_fragment(struct net *net, struct sock *sk, struct sk_buff *skb,
> struct ip_frag_state state;
> int err = 0;
>
> + /* psp and tls offload need the packet's l4 header, which non-initial
> + * fragments do not have
> + */
> + if (unlikely(skb_is_decrypted(skb))) {
> + err = -EMSGSIZE;
> + goto fail;
> + }
> +
[Severity: High]
Does ip6_fragment() need the same check? The commit message says:
an ipv6 tcp socket does not ever emit fragments. ip6_fragment() refuses
skbs bigger than the mtu unless ignore_df is set, which tcp doesn't set.
TCP doesn't set ignore_df itself, but IPVS sets it on locally generated
IPv6 skbs, for example in ip_vs_bypass_xmit_v6() and ip_vs_dr_xmit_v6():
net/netfilter/ipvs/ip_vs_xmit.c:ip_vs_dr_xmit_v6() {
...
/* Another hack: avoid icmp_send in ip_fragment */
skb->ignore_df = 1;
...
}
When ignore_df is set, the only size check in ip6_fragment() does not
fire:
net/ipv6/ip6_output.c:ip6_fragment() {
...
mtu = ip6_skb_dst_mtu(skb);
...
if (unlikely(!skb->ignore_df && skb->len > mtu))
goto fail_toobig;
...
}
IPVS has its own MTU check in __ip_vs_get_out_rt_v6() ->
ensure_mtu_is_adequate(), but that check uses dst_mtu(&rt->dst).
ip6_skb_dst_mtu() switches to the device MTU when the socket has
IPV6_PMTUDISC_PROBE or higher set:
if (np && READ_ONCE(np->pmtudisc) >= IPV6_PMTUDISC_PROBE) {
mtu = READ_ONCE(dst_dev(dst)->mtu);
ip_metrics_convert() caps RTAX_MTU at 65520, not at the device MTU, so a
route MTU above the device MTU is accepted.
That seems to open this path for an IPv6 kTLS offload or PSP socket that
uses IPV6_PMTUDISC_PROBE, INTERFACE or OMIT and connects to an IPVS
service over such a route:
ip6_xmit()
NF_INET_LOCAL_OUT hook
ip_vs_dr_xmit_v6() /* passes dst_mtu() check, sets ignore_df */
ip_vs_send_or_cont()
ip6_output()
__ip6_finish_output() /* skb->len > dev->mtu */
ip6_fragment()
ip6_frag_next() /* alloc_skb() + ip6_copy_metadata() */
ip6_copy_metadata() doesn't copy ->decrypted, so every fragment reaches
the device with decrypted == 0.
Wouldn't the TLS or PSP payload then go out in cleartext, as it does in
the IPv4 case without this patch?
The setup is similar to the IPv4 reproducer in the commit message: a
manipulated route MTU plus a PMTU socket option. Later patches in the
series don't touch net/ipv6/ip6_output.c.
Could the same skb_is_decrypted() check be added at the top of
ip6_fragment(), and the ipv6 paragraph of the commit message updated?
> /* for offloaded checksums cleanup checksum before fragmentation */
> if (skb->ip_summed == CHECKSUM_PARTIAL) {
> err = ip_check_csum_start(skb);
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261103001143.246081-1-toddfreed%40meta.com
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads