Article View: linux.kernel.netdev
Article #26557Re: [PATCH net-next v5 1/2] ipv6: Cache pmtu for all paths of a multipath route
From: netdev-bot+sashiko
Date: Thu, 03 Dec 2026 19:01
Date: Thu, 03 Dec 2026 19:01
163 lines
13366 bytes
13366 bytes
Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.
Critical: 0 · High: 1 · Medium: 1 · 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 new walk over every path of a multipath route in
__ip6_rt_update_pmtu() (net/ipv6/route.c) still sits behind the…
- [Medium] rt6_nh_update_pmtu() adds a check-then-write on exception
routes that holds no lock.
--
ipv6: Cache pmtu for all paths of a multipath route
When a Packet Too Big is received, __ip6_rt_update_pmtu() now walks
every path of a multipath route. This covers both legacy siblings and
nexthop objects. On each path it updates an existing exception in place,
or creates one if the reported MTU is lower than that path's MTU,
following what IPv4 does since commit 7d3f3b4367f3.
Link: https://lore.kernel.org/netdev/ad29493c-9e48-4a94-b327-e47af3a9d137@kernel.org/
> diff --git a/net/ipv6/route.c b/net/ipv6/route.c
> index df843178e5ecc..cd3672287afed 100644
> --- a/net/ipv6/route.c
> +++ b/net/ipv6/route.c
> @@ -2917,12 +2917,63 @@ static bool rt6_cache_allowed_for_pmtu(const struct rt6_info *rt)
[ ... ]
> +static int rt6_nh_update_pmtu(struct fib6_nh *nh, void *_arg)
> +{
> + struct rt6_pmtu_arg *arg = _arg;
> + struct fib6_result *res = &arg->res;
> + struct rt6_info *rt;
> +
> + res->nh = nh;
> + rt = rt6_find_cached_rt(res, arg->daddr, arg->saddr);
> + if (rt) {
> + /* Keep any gateway learned from a redirect. */
> + if (arg->mtu < dst6_mtu(&rt->dst)) {
> + rt6_do_update_pmtu(rt, arg->mtu);
[Severity: Medium]
Can this in-place update race with a device MTU decrease?
The check and the write here run under RCU only. There is no
rt6_exception_lock and no re-check against fib6_mtu(res). The device MTU
change path writes the same metric under the lock:
rt6_mtu_change()->fib6_nh_mtu_change()->rt6_exceptions_update_pmtu() {
...
if (dst_metric_raw(&entry->dst, RTAX_MTU) &&
rt6_mtu_change_route_allowed(idev, entry, mtu))
dst_metric_set(&entry->dst, RTAX_MTU, mtu);
...
}
rt6_insert_exception() re-checks under the lock for this exact reason:
/* rt6_mtu_change() might lower mtu on f6i.
* Only insert this exception route if its mtu
* is less than f6i's mtu value.
*/
if (dst_metric_raw(&nrt->dst, RTAX_MTU) >= fib6_mtu(res)) {
A possible interleaving:
CPU0 (softirq, PTB mtu=1400)
rt6_nh_update_pmtu()
arg->mtu (1400) < dst6_mtu(&rt->dst) (1500)
CPU1 (NETDEV_CHANGEMTU to 1300)
rt6_exceptions_update_pmtu()
dst_metric_set(&entry->dst, RTAX_MTU, 1300)
CPU0
rt6_do_update_pmtu(rt, 1400)
dst_metric_set(&rt->dst, RTAX_MTU, 1400)
ip6_dst_mtu_maybe_forward() returns the raw metric without clamping it to
the device MTU. The exception would then report 1400 on a 1300 MTU
device until it expires (ip6_rt_mtu_expires, 600s by default).
The RTF_CACHE branch for the selected dst in __ip6_rt_update_pmtu()
already had this unlocked pattern. This patch adds a new instance that
applies to the exceptions on every path.
Should the in-place update take rt6_exception_lock and re-check
fib6_mtu(), as rt6_insert_exception() does?
> + fib6_nh_update_exception(nh, res->f6i->fib6_src.plen,
> + rt);
> + }
> + return 0;
> + }
> +
> + if (arg->mtu >= fib6_mtu(res))
> + return 0;
[ ... ]
> @@ -2945,6 +2996,7 @@ static void __ip6_rt_update_pmtu(struct dst_entry *dst, const struct sock *sk,
>
> if (mtu < IPV6_MIN_MTU)
> return;
> +
> if (mtu >= dst6_mtu(dst))
> return;
[Severity: High]
Does this early return still block the per-path walk in the case the
commit message describes?
This check only compares against the MTU of the dst that the PTB lookup
selected. ip6_update_pmtu() builds that lookup without protocol or
ports:
struct flowi6 fl6 = {
.flowi6_oif = oif,
.flowi6_mark = mark ? mark : IP6_REPLY_MARK(net, skb->mark),
.daddr = iph->daddr,
.saddr = iph->saddr,
.flowlabel = ip6_flowinfo(iph),
.flowi6_uid = uid,
};
dst = ip6_route_output(net, NULL, &fl6);
So the lookup can select path A while the flow actually uses path B.
Path A may already have an MTU at or below the reported value. It may
have a smaller link MTU, or it may still hold a lower exception after
B's was flushed or evicted. In either case __ip6_rt_update_pmtu() returns
here, before rcu_read_lock(), and never reaches the nexthop or sibling
walk.
For example, path A has link MTU 1400 and path B has 1500. The flow is
hashed to B, and a router on B reports 1450. The lookup selects A, the
check 1450 >= 1400 returns, and B keeps a PMTU of 1500. Oversized
packets on B continue to be dropped.
rt6_nh_update_pmtu() already makes its own per-path comparison:
if (arg->mtu >= fib6_mtu(res))
return 0;
Could this check gate only the in-place update of rt6, and let the walk
run either way?
IPv4's __ip_rt_update_pmtu() has a similar old_mtu < mtu gate. However,
the commit message here says "Compare the reported MTU with the MTU in
use on each path".
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261202182545.19656-1-deliran%40verdict.gg
Technical Details
Message-ID:
<179632450109.3146.11168142309643609135@kernel.org>Path:
mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376831-linux-kernel-netdev=dewy.ruReferences:
<20261202182545.19656-2-deliran@verdict.gg>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376831-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v5 1/2] ipv6: Cache pmtu for all paths of a multipath route Date: Thu, 03 Dec 2026 19:01:41 +0000 Organization: Usenet Network Message-ID: <179632450109.3146.11168142309643609135@kernel.org> References: <20261202182545.19656-2-deliran@verdict.gg> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="2571727"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:1UPiX37D6HGifLzdAMtiFDDc6pE= sha256:UFRHfouU83dmcx2QRrZZoOx11vKFBmRlPuuSl2+fULM= sha1:AVzbUunKAUWIv6q4CvCSFpLLqMU= sha256:ZcCDSKQZx9kNFobP91CMqpffcwJkOlY4yVPtmnkRmdA= 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 C061A117A1A; Thu, 3 Dec 2026 22:02:28 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.64 X-Spam-Status: No, score=-3.64 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.24, 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] 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 hL1CU-rkRlPQ; Thu, 3 Dec 2026 22:02:21 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-376831-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 E2CE6117A16; Thu, 3 Dec 2026 22:02:12 +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 782552CE3D; Thu, 3 Dec 2026 19:01:43 +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=1796324503; b=PMoAQnjec0bCTtfXi7xdDxVNrllo42pilvBIzK0hutUN4gCLRYDXwa0jFi4wf3PTwvAh h3rpPOBRLikBCDQ/6kgr+6DUrjPLppRnk7WcFqVhij/VWF7Bh0OBDSOo9hDVR4278Gaks gsspEd3INfU167xlz2Jrzi3dMQb/vVPnck87wrATD6Tm0Gca8Hu1H0cQEbETqnoTUo1Mx +pQUCwcN7AsCmgETo8639oz7yFLvzHzDDTSjvL1T+28lEo3lHuWQgtaFzYuUNB2R2Lx/J h+2s9/OeA9vaWRTUcdE4LOVxLF/LY/FC9bECV3ULR3yPSXhLyx34hi3TtDye/0e2V8A== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796324503; 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=eWB8yeXwnubcQ1o7JRHr9gFMso0Qn9d0Mqu3DlRq94w=; b=I3Vsf5Xq7Dz22yWEDQh4o4edRI0/KAU7GLkdU6rgc8xT5JLmKKVQpIy7xVsV6q26j1ow JxoSF4FH97mKqtRwPm2DwBO3zG7L5BFwXlAqEa/kfZ/rHNehJ//Po/CmQ3Rct+X/ief3X w4Z29KJK02nylnmR7hJ7TX8Njf8wkbNlMXvP3KQNqNtWeER01hZIQg2tlsvGJrPAwRXw+ mXT+ZOGqzKZ7Rj7tc2u/Lq09UpIt2h5LrwbuPhzvDk4Ema94FjLFHjfaEDY+CnYM2LX95 9tWWpCV/pkaA1hmcRZ5yHog6PLLdHb2ykCJsHDItCI3diPnYnp9pnpJeLO9OUXxzJCA== 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=ZTr7xQpG; 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 4EBBA606A335; Thu, 3 Dec 2026 19:01:43 +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=ZTr7xQpG 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=1796324502; b=fmSo7uY//lctN1vk7ouVCXOyAxmVCRpLeSDYUJZGAp4MwLUB6cj22k+yxIzdV/Nd3S2W JYN9TPqadc6Uv97YC/PT4EpdYTIZ9GK9KujH8Yp27Lj/t0WbIT61/umC54m5p5Vc3vE9n CBby3v8Hh/jsPE8Wizv6V8QIy5jE/jmryhY0b0O/Gof2sclPT8Mx2pKIFGk1EoBjRROOB XKBf+MlC58fwO05iXEGnlR6i5sAVBENDT6qwdl59qPfgpHXcBameVFmLKTX1xqVSoEeC5 xCAN7VBhVdYv07xfpL5JEFSe7eO/pwiRTS7PJdhtl00Q6M31EunVB3d3yJ3KVGd42xg== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796324502; 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=eWB8yeXwnubcQ1o7JRHr9gFMso0Qn9d0Mqu3DlRq94w=; b=to0VZAA3zhZ2SVLfgWnXIjdkqyA/UsNQH2A/UAxu9BwYC48CaTNX2UObFNiYVhuqAFFu WU5g6gDCAeywWOcOouLB0RxiDGyuqOmwVVcTvGPMUCKBKzjDTg28e9KWxG533o0CLIbEO 8s8b2PXbIplL2qlZusBxZwE9ll/jssmsaaqVTlOTUUGD5toUAzxTdrYZCll3aAORwUc0M JER+TGNxfga1ZXjXK2g0s0+ghxzg5eDR89s0jwVpiKSpFf4azsIQcKWqQZ6S0h40pVHtN N0J0mBfnscgdA833QvpeCgkU1CLe+XkyNfz+Y3wUzAAJw6TMiBpHs4GfSeYzxWU7xuA== 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=ZTr7xQpG; 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 6C761606A332; Thu, 3 Dec 2026 19:01:42 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8989F1F0092C; Thu, 3 Dec 2026 19:01:41 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796324502; bh=eWB8yeXwnubcQ1o7JRHr9gFMso0Qn9d0Mqu3DlRq94w=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=ZTr7xQpGxl9TZnX9KGQYF7Ov39Io6kAsp8d2C5Q/2k3CsQpFeU/Qqvg28by/KMiRO BO3iEyf7lV9MA0C03MSDbgy8wwMItLCcMFP+SbglwMWJCnYEP3avQvAEsE23mnTk+p suGWhlls3B7/VTNA3xtK5kTL2chKuAxOOdIl9obI7PaDggGWj5uhHJmUHQFmKJbjIm CKuM+O7QYi8xZUw2YijgI+JkbfofAN9VPLpsBkk1dkhzXqrXIau2cgOtmbFpFwV7KZ EF2wWZ3RoD1Xdy3x1e+G6zc+MIAMepPQQLhcSYYuwL7oBoTVLNd33CoPsBmh7v94V4 Q6W9Vhl8fiBfg== X-Cc: dsahern@kernel.org, idosch@nvidia.com, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, willemb@google.com, horms@kernel.org, shuah@kernel.org, netdev@vger.kernel.org, linux-kselftest@vger.kernel.org X-In-Reply-To: <20261202182545.19656-2-deliran@verdict.gg> 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