From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 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== 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== 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 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) 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 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8989F1F0092C; Thu, 3 Dec 2026 19:01:41 +0000 (UTC) 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== Subject: Re: [PATCH net-next v5 1/2] ipv6: Cache pmtu for all paths of a multipath route From: netdev-bot+sashiko@kernel.org To: deliran@verdict.gg 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 Date: Thu, 03 Dec 2026 19:01:41 +0000 Message-ID: <179632450109.3146.11168142309643609135@kernel.org> In-Reply-To: <20261202182545.19656-2-deliran@verdict.gg> References: <20261202182545.19656-2-deliran@verdict.gg> X-sashiko-severity: High Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 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