Article View: linux.kernel.netdev
Article #17215Re: [PATCH net-next v2 2/2] ipv6: preserve ip6mr_get_route() error in rt6_fill_node()
From: netdev-bot+sashiko
Date: Mon, 16 Nov 2026 13:54
Date: Mon, 16 Nov 2026 13:54
154 lines
12770 bytes
12770 bytes
Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · 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).
- [Medium] The patch does not deliver the 'actual failure reason' its
commit message promises.
- [Low] The patch fixes a user-visible wrong errno (RTM_GETROUTE returns
EMSGSIZE, 'Message too long', instead of the underlying…
--
ipv6: preserve ip6mr_get_route() error in rt6_fill_node()
With this patch, rt6_fill_node() returns the negative error from
ip6mr_get_route() to the caller. Before, it always returned -EMSGSIZE.
Attribute put failures still return -EMSGSIZE.
> Suggested-by: Hangbin Liu <liuhangbin@kylinos.cn>
> Signed-off-by: Wenbo Sun <sunwenbo@cmss.chinamobile.com>
[Severity: Low]
This fixes an errno that userspace can see, but there is no Fixes: tag.
It also isn't clear whether the patch is aimed at net or net-next.
The -EMSGSIZE that hides ip6mr_get_route() failures goes back to
commit 7bc570c8b4f75d ("[IPV6] MROUTE: Support multicast forwarding.").
Commit fd61c6ba313de6 ("net: ipv6: remove nowait arg to rt6_fill_node")
simplified that branch and kept it.
If this is meant for net, should it carry a Fixes: tag? If it is meant
as a net-next change to an errno visible to userspace, could the commit
message say so?
> diff --git a/net/ipv6/route.c b/net/ipv6/route.c
> index cb8cfd8b5c8b7..fc4f4c1cda583 100644
> --- a/net/ipv6/route.c
> +++ b/net/ipv6/route.c
[ ... ]
> @@ -5864,12 +5865,14 @@ static int rt6_fill_node(struct net *net, struct sk_buff *skb,
> #ifdef CONFIG_IPV6_MROUTE
> if (ipv6_addr_is_multicast(&rt6_dst->addr) &&
> atomic_read(&net->ipv6.devconf_all->mc_forwarding)) {
> - int err = ip6mr_get_route(net, skb, rtm, portid);
> + int ret = ip6mr_get_route(net, skb, rtm, portid);
>
> - if (err == 0)
> + if (ret == 0)
> return 0;
> - if (err < 0)
> + if (ret < 0) {
> + err = ret;
> goto nla_put_failure;
> + }
[Severity: Medium]
Does this actually give userspace the real failure reason?
inet6_rtm_getroute() is the only caller that passes a non-zero iif. It
builds the reply skb without ever setting skb->dev:
net/ipv6/route.c:inet6_rtm_getroute() {
...
skb = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL);
...
skb_dst_set(skb, &rt->dst);
...
}
With skb->dev NULL, ip6mr_get_route() skips the (*,G) lookup. It then
returns -ENODEV every time there is no (S,G) cache entry:
net/ipv6/ip6mr.c:ip6mr_get_route() {
...
cache = ip6mr_cache_find(mrt, &rt->rt6i_src.addr, &rt->rt6i_dst.addr);
if (!cache && skb->dev) {
...
if (!cache) {
...
dev = skb->dev;
if (!dev || (vif = ip6mr_find_vif(mrt, dev)) < 0) {
rcu_read_unlock();
return -ENODEV;
}
...
}
So when mc_forwarding is enabled, RTM_GETROUTE for any multicast (S,G)
with no MFC entry now fails with "No such device". This happens whether
or not the iif is a registered MIF. It also happens even though
inet6_rtm_getroute() has just found the device with
dev_get_by_index_rcu().
The "ip -6 route get ff0e::1 from 2001:db8::3 iif d0" test in the
commit message seems to show this case: the device d0 exists, but the
reply is still "No such device".
inet6_rtm_getroute() already returns the same errno when the iif
ifindex doesn't exist:
dev = dev_get_by_index_rcu(net, iif);
if (!dev) {
rcu_read_unlock();
err = -ENODEV;
goto errout;
}
Because of that, userspace can't tell a missing interface from a
missing multicast cache entry.
The commit message says:
"(for example -ENODEV, -ENOENT, -ENOMEM, or -ENOBUFS)"
-ENOMEM and -ENOBUFS only come from the alloc_skb() and
ip6mr_cache_unresolved() branch, and that branch needs a non-NULL
skb->dev. Can any caller reach them?
In practice the values that can occur look like:
-ENODEV
-ENOENT (no table, or mr_fill_mroute() on an unresolved entry)
-EMSGSIZE
-EINVAL (from the mr_fill_mroute() stub)
For comparison, inet_rtm_getroute() in net/ipv4/route.c does set the
device:
skb->dev = dev;
That lets ipmr_get_route() handle the (*,G) lookup and the unresolved
queue.
Should inet6_rtm_getroute() set skb->dev the same way? That would also
mean handling the async unresolved-queue path. Otherwise, should the
commit message be corrected, possibly with an extack message added?
> } else
> #endif
> if (nla_put_u32(skb, RTA_IIF, iif))
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261112094630.197244-1-sunwenbo%40cmss.chinamobile.com
Technical Details
Message-ID:
<179483727608.3136.10892831786069181339@kernel.org>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364379-linux-kernel-netdev=dewy.ruReferences:
<20261112094630.197244-3-sunwenbo@cmss.chinamobile.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364379-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v2 2/2] ipv6: preserve ip6mr_get_route() error in rt6_fill_node() Date: Mon, 16 Nov 2026 13:54:36 +0000 Organization: Usenet Network Message-ID: <179483727608.3136.10892831786069181339@kernel.org> References: <20261112094630.197244-3-sunwenbo@cmss.chinamobile.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="2078641"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:/XAAftmWdYsd50WZwVmNDRJ+WIw= sha256:z1qw0C0WID6Q9VIzmSREiAgwcWJveObfiOfuGHVUclw= sha1:RiWaKZTqf0T2w6niyj0vXs7OvVg= sha256:8/MNHGup+VVyN4H7+z5HW6dbjSLBw+AXrPqa4TSuf6k= 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 79BE4114C4F; Mon, 16 Nov 2026 16:55:56 +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 X4YLJdghGrUh; Mon, 16 Nov 2026 16:55:52 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-364379-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 BB9C3114C45; Mon, 16 Nov 2026 16:55:43 +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 5425A31252; Mon, 16 Nov 2026 13:54:57 +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=1794837278; b=O4wdwrGl5sxi9U8SkbYvE0L4z6NEII0np8nDCwRHHBx5Sg12UpezZKXyB0Ce43EZNx2E PFiSINmkJ8eRaHSz7h5XwLV/zDeHbDSUeaqKe9ji2K7WYL534O1zEeVopyhzuGOYMN3sj SFhoLv4ht0XdLFiE+sSyd8ER4pz1GHi7eeeUysE0rY586s/YTAAabrCF6Z8be7VZNCNMp lnS+zI4+HzTy8El2f2w7VkgamvQkJY/CFVZ5RXjj9B1HP5kXgJum2NixZuB9CbuO4wmao icJUMJ3fMi23kVR1P/VBLuE/nrH9+0mk6TXwo2/Y6n1SVDTnb09vvOHe0CxG0XQ9jqQ== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794837278; 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=JggSB6ekhFS9ZRgWZdXNb2Vb+145I6VBPjU4N4yalQY=; b=IKN+xVfjz/zEHZpTUj8OWiShn8yFjarIe8xfcm0q8pH4vTo9v5VjYPlbQ4PD+j3N288Z L7UaIoOo3HUBQZ5MDeUjIdG6B1VV3aKwH7nq3gjvBxavC2G6cTuePUGTk06Gi1Nv2q/fU +6VfT/kI1OPzOJEJoW7Jsndzerx/5hnTc16zyOni+JVobJFpXceIW4PNEcRpy4UDE6AeX kEcvvUzSz2Q6ikFWFUrunxm+nwtVTqXhv+Uu8rWC3ThI8TRZSjvBwQDTHK/RDydXwS6xz PalHry/5QZ1OGpEPIwGQsBLKOH4oNiad+r/IDyVhaZMEzDH1c3yr/q0M4Gq8Eg+sMmg== 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=KIRJnmC3; 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 57B47606A8B8; Mon, 16 Nov 2026 13:54:38 +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=KIRJnmC3 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=1794837277; b=C1OyW+MxolrF2HTPcn3qLdfW5ITK1AS0k9RGNzJwPkHaPQd0qwZ9oWmNo6IKyMLjxV+i C5cFbQcxt3/WllfRw5DSTNAHqWbiIQ0e7yr4gbTaK8hH5tmQcS3FdyuARd6NbxQfD2PNz BDNyek6PqHLoB9ipYPwuEOX8F68QnJeR2+etrVo6XQTzzaeDr66slz+1QderoMZL3JMw2 FWW0xBFGxV1SQsPYgwHzUuSKhx/jMjf6JFPgSTrj+Tt98sSAhCqxl8afeAcNyrtwH0bRO q1u9KV/c7s6qbE99IcmQvVqQYnDYd2aRwZr2u/mKMGZ13x+ndGkCkHnsR+/GA53O0Ag== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794837277; 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=JggSB6ekhFS9ZRgWZdXNb2Vb+145I6VBPjU4N4yalQY=; b=qU+60I5MDr3JIz5aqvkfhTpjnLDAEhm74d6LY2o2rsBqzHqKp03N2fWs5g1QAc9aUTgX 7dgpRwzp3ybYP0hFCnAFv4iJScyeuZAArlXUinCsDsQzNl8Tk+i1k/wi+H2n0LioZljH+ CGw2lhPVtkzdC/TUSW3p+DotKH5nqSgOvTLUlLXmfwMNua1TWsoVWaNvUyW02R60OdodB IclZkBRIaEKQZ14xdqjF75HLujUgT2Zd5Yc7pEIyE9dse2E3YXNkEW0wsS68T+ZIDA9s4 ozVx4fvRIH9QoW9MQX+BLc12LGVg0x/hbSX1yWF91JLwKWtLO16CQr7kphtVMpihc+w== 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=KIRJnmC3; 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 77E9B606A896; Mon, 16 Nov 2026 13:54:37 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 82F711F000C5; Mon, 16 Nov 2026 13:54:36 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1794837277; bh=JggSB6ekhFS9ZRgWZdXNb2Vb+145I6VBPjU4N4yalQY=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=KIRJnmC34sHnJy/vcVkOHMeemqVfTteiBWlkkJxQnLG7FBlgywxXHEblXp4b76HwZ dV9SP50obR9XVWSPZJkvLPC75HaFMAz23GZwiknSp9HDOZqWIOdSXj2xlBByWLc9PY foovWYZKD/+uYG6n0dAK1gPduziA11P9lmXfJAF2i6f98A6A0sGpTRGsWgPI8Gi+i8 owTxX5mdVDDtzfG/8bfg4RHy6C41q0oTqrhmtJeq/gD9UAI5WWwAz8+I0dH/ZC6hVD pwYQhvJbu1aqnKAd/AtdJKr3qRTR7+GQw35nNAfI6/n1T1HQIPqvysKpxVT7PsS8Oo TpP/+Owp77CQQ== X-Cc: dsahern@kernel.org, idosch@nvidia.com, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, hangbin.liu@linux.dev, liuhangbin@kylinos.cn, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, 1342116488@qq.com X-In-Reply-To: <20261112094630.197244-3-sunwenbo@cmss.chinamobile.com> X-sashiko-severity: Medium 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