Article View: linux.kernel.netdev
Article #16135Re: [PATCH net-next 02/15] netfilter: flowtable: fix pmtu discovery in nf_flow_tunnel_ip6ip6_push()
From: netdev-bot+sashiko
Date: Sat, 14 Nov 2026 03:23
Date: Sat, 14 Nov 2026 03:23
133 lines
12568 bytes
12568 bytes
Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.
Critical: 0 ยท High: 1 ยท Medium: 0 ยท Low: 1
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 fix does nothing.
- [Low] The commit subject and body name nf_flow_tunnel_ip6ip6_push(),
which does not exist in the tree being patched.
--
netfilter: flowtable: fix pmtu discovery in nf_flow_tunnel_ip6ip6_push()
This commit moves skb_dst_update_pmtu_no_confirm() ahead of
skb_scrub_packet() in nf_flow_tunnel_ip6_push(). The aim is to run the
PMTU update before skb_scrub_packet() drops the skb dst. The inner route
would then get the tunnel MTU, as it does in ip6_tnl_xmit().
> netfilter: flowtable: fix pmtu discovery in nf_flow_tunnel_ip6ip6_push()
>
> nf_flow_tunnel_ip6ip6_push() invokes skb_scrub_packet() before updating
> the PMTU.
[Severity: Low]
This isn't a bug, but there is no nf_flow_tunnel_ip6ip6_push() in this
tree. Commit 93cf357fa797 added it under that name, and it was later
renamed to nf_flow_tunnel_ip6_push(). It now also takes a dst argument and
handles an IPPROTO_IPIP inner protocol.
Could the subject and body use the current name? It could also say that
the change touches 4in6 encapsulation (e.g. DS-Lite) as well as IP6IP6.
> diff --git a/net/netfilter/nf_flow_table_ip.c b/net/netfilter/nf_flow_table_ip.c
> index 19cafae748abe..644e70fd6773b 100644
> --- a/net/netfilter/nf_flow_table_ip.c
> +++ b/net/netfilter/nf_flow_table_ip.c
> @@ -699,10 +699,10 @@ static int nf_flow_tunnel_ip6_push(struct net *net, struct sk_buff *skb,
> if (err)
> return err;
>
> - skb_scrub_packet(skb, true);
> mtu = dst_mtu(dst) - sizeof(*ip6h);
> mtu = max(mtu, IPV6_MIN_MTU);
> skb_dst_update_pmtu_no_confirm(skb, mtu);
> + skb_scrub_packet(skb, true);
[Severity: High]
On the flowtable fast path, is there a dst on the skb at this point?
Flowtable hooks can only be registered at netdev ingress:
net/netfilter/nf_tables_api.c:nft_flowtable_parse_hook() {
...
if (hooknum != NF_NETDEV_INGRESS)
return -EOPNOTSUPP;
...
}
This means nf_flow_offload_ipv6_hook() runs before ip6_route_input(), so
no routing dst is attached yet. The outer tunnel dst only comes in as the
dst argument:
nf_flow_offload_ipv6_hook()
nf_flow_queue_xmit6()
nf_flow_tunnel_push(state->net, skb, other_tuple,
tuplehash->tuple.dst_cache, &ip_addr)
nf_flow_tunnel_ip6_push()
The skb only gets that dst after the push returns, and only for
FLOW_OFFLOAD_XMIT_NEIGH:
net/netfilter/nf_flow_table_ip.c:nf_flow_queue_xmit6() {
...
xmit.dest = neigh->ha;
skb_dst_drop(skb);
skb_dst_set_noref(skb, &rt->dst);
break;
case FLOW_OFFLOAD_XMIT_DIRECT:
...
}
skb_dst_update_pmtu_no_confirm() does nothing when skb_dst(skb) is NULL:
include/net/dst.h:skb_dst_update_pmtu_no_confirm() {
struct dst_entry *dst = skb_dst(skb);
if (dst && dst->ops->update_pmtu)
dst->ops->update_pmtu(dst, NULL, skb, mtu, false);
}
So the mtu computed from dst_mtu(dst) looks like it is thrown away both
before and after this change.
Ingress sometimes attaches a metadata dst (collect_md or tunnel_key).
That dst uses dst_blackhole_ops, and dst_blackhole_update_pmtu() is
empty. It is also not the flow's inner route.
There also doesn't seem to be an inner route left to update, because
nft_dev_forward_path() replaces it with the tunnel dst:
net/netfilter/nf_flow_table_path.c:nft_dev_forward_path() {
...
dst_release(route->tuple[dir].dst);
route->tuple[dir].dst = info.tun_dst;
...
}
The ip6_tnl_xmit() comparison depends on ip6_forward() having already put
the inner route on the skb. The flowtable fast path skips that step.
If that reading is right, the patch reorders a call that never has any
effect. The PMTU update described as "silently lost" would still be lost
on every fast-path packet.
Would one of these work better: dropping the call, updating an
explicitly stored inner dst, or relying on (and documenting) the
nf_flow_exceeds_mtu() check in nf_flow_offload_ipv6_forward()? That check
already sends oversized packets to the slow path, and ip6_tnl_xmit()
handles PMTU there.
At the end of the series the code still does the skb_dst(skb) based
PMTU update, followed by skb_scrub_packet(skb, false), so later patches
don't seem to fix this either.
--
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261113031251.2437074-2-pablo%40netfilter.org
Technical Details
Message-ID:
<179462661985.2199510.8150694515960866760@kernel.org>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-363066-linux-kernel-netdev=dewy.ruReferences:
<20261113031251.2437074-3-pablo@netfilter.org>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-363066-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next 02/15] netfilter: flowtable: fix pmtu discovery in nf_flow_tunnel_ip6ip6_push() Date: Sat, 14 Nov 2026 03:23:39 +0000 Organization: Usenet Network Message-ID: <179462661985.2199510.8150694515960866760@kernel.org> References: <20261113031251.2437074-3-pablo@netfilter.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="1499367"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:4KW5g8zAaMLyuYh5k/ZUU0V4Jzs= sha256:KxzmDDfHuo8k2SHCNVwDyuHw5TMiKaS0N1lSEQObwD8= sha1:Fc+Y9o05oyiNosV1SboGa/IdbgM= sha256:CvBVvQeDP/zud89xJqdCFQsNyrh3SblohqYRyN0smfo= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 595E711474D; Sat, 14 Nov 2026 06:24:07 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.4 X-Spam-Status: No, score=-3.4 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jw7Ucgn5jo2I; Sat, 14 Nov 2026 06:24:03 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-363066-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id BBAA611474B; Sat, 14 Nov 2026 06:23:54 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id A6D1448037; Sat, 14 Nov 2026 03:23:48 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1794626622; b=KEsc/iST3IpwTvc1TGf7drgkX1VfvvX7ubqYGY8wWhYQ3KFmwYGzVfuU7VXLXziHlFq4 IC/dYAkqTcO0PiAGTWr/WnT7giqi2ZOFTtk9Ffl9HcXmteZgYUnW7RUMoqn9Mu260dY/S aoASIHoh40cXQOhKBfdZ/6poF11GI1SinvbpTMDlAss6nXrvzSB0v6F88vUi8201feI4F pHS8YJYlQmFya5rvak16mTvA/AaMRPBJZW6hoI9UqxD0x/YRXjbMw12Un8icZL0GHUMwy xAJrNHNAxLQq7Td+or+CGGJePvVIaZK7qIxvR9VpktMYkzc1GKnEODn69affJSk4sXA== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794626622; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=R5z+Zu2KwpyHx5FJM0sdOZwAch8rq5B9StB8kRHeq+k=; b=EB1Spk+mbN0zum/LZt1Q+qNq1ysaoPpcx0O0uuN+iLo4tzohyWVHqYK/LPoW/8qBLyz1 /VamShlev05qgDpyq0+7JDv3yEwST6rQxnS+ewUtm8ClupDJ6wJpfFY92aX0feZIeWcSl lZWvEl+DDM0YcuDxfPjpsOJ/nEvIdD/VrV3+uvOwil9ERSDl1uoO01KU4rW4Gu+qjEVvu km9O+WbHm4jzdt2u240uxPScmcfnRbXlLBEhPv9TthDq2aLBtho5m0uhZIuJsiAT2TPNr DKzv6+ljvLx7W0Vs7AtmXwBJL4CQy4QxClMNtCHG4XedEbPO0iksUSahMis97TNtRYg== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=e2HTWLUs; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2B63D606A883; Sat, 14 Nov 2026 03:23:42 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=e2HTWLUs X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794626621; b=eqvVPH4U96PzGmLEVAPNRuC539WYL66FStNET5hG9Bf1SfaO0l4DJCx3bPcBBlORJbkD zoIO6noGTmjgnAbNrQ96G1SjqN3jaiS3VaNYXFZK1W8ycHXiwiahTw46A7KL+E93MYIH3 RN97xR2/d9sJ5zCjV++d93XTO9p9eQ56lAocO0xxyuG6RQ0EJN41kd9xk6KXlK0C8C8o3 LMXOhQY5zBL9qPQjKdeRag0CzCPO8/+7ZGAIjadNHVJ7tdKIsTo2qAu4aXRuyxvIitDf8 xjm7ZucjjDMr+Jqk89ELQoArabvKuYTBGJIF33WYKJuLDG3FkaY8d35dXVYiQ/aoMPw== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794626621; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=R5z+Zu2KwpyHx5FJM0sdOZwAch8rq5B9StB8kRHeq+k=; b=h7S0jy0kj6cMYq0FxY0M9zdnyp/Rsr1P6ciJxvvBdL7rNI+d4DXMFmV2YyWNAvql4LzM Ot+Did2ypnBUp4onl7a8LBqRn1svBQ7l/vU+RDjBdbCjPaZcxWY1MUoKr0f0xz7I6B9cM OC/pU8/yreNbSnMHv+ZJ84H2GaoU9SiYDqJMYf9WeCKvLDRvdpTyqMdS5cqaUbxICzoEO ZL1/K9sQp1sjrDLr5lp/3AI5Aek6cwzeZ900b71GqIT/EIyeuJ3wqaKkBwRK6nr86AJXw Oq85zd5qZ3NoYxntHHzDFgg8UoQDfF3pv5pbMTaPn3+tVcb1aIPyBnyNu21DOwsJP9w== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=e2HTWLUs; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4B1A8606A882; Sat, 14 Nov 2026 03:23:41 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 537081F000C4; Sat, 14 Nov 2026 03:23:40 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1794626620; bh=R5z+Zu2KwpyHx5FJM0sdOZwAch8rq5B9StB8kRHeq+k=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=e2HTWLUszIRuA5PO/oRb63LJVXvxQWqZ9VY+5Ol0yK8IqglEEO86zhh4n/9RJdvfk wb4fmQbmarKCc638MHeNfh60ygGTAyJJ1xthQcnyhnF1Iz2NHO4hjCfvxKy1l46GvD J+LdGeFeV4WjvvB21CIyEyTU9Pp/uHWfOBFe00SF58EHmMB/P3h7wqrTbvZckLzYMg XPGONrjShUkVG30eexbckDsqeoNwvrTu5w7CiFbYpg/UmDPqTpAfOb/rSY2Aa3necw wbkysEHyB3aNhyEAlH/XeA+d75NwRz6FhMVqJEuOmqcyApSVGSFmIGwIHBHIIo2goz V0AqpWf1UhzMg== X-Cc: netfilter-devel@vger.kernel.org, davem@davemloft.net, netdev@vger.kernel.org, kuba@kernel.org, pabeni@redhat.com, edumazet@kernel.org, horms@kernel.org, fw@strlen.de, ja@ssi.bg X-In-Reply-To: <20261113031251.2437074-3-pablo@netfilter.org> X-sashiko-severity: High X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list