From: netdev-bot+sashiko@kernel.org
To: sunwenbo@cmss.chinamobile.com
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
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 [thread overview]
Message-ID: <179483727608.3136.10892831786069181339@kernel.org> (raw)
In-Reply-To: <20261112094630.197244-3-sunwenbo@cmss.chinamobile.com>
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
next prev parent reply other threads:[~2026-11-16 13:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-12 9:46 [PATCH net-next v2 0/2] ipv6: fix rt6_fill_node() multicast route query handling Wenbo Sun
2026-11-12 9:46 ` [PATCH net-next v2 1/2] ipv6: check mc_forwarding before calling ip6mr_get_route() Wenbo Sun
2026-11-16 13:54 ` netdev-bot+sashiko
2026-11-12 9:46 ` [PATCH net-next v2 2/2] ipv6: preserve ip6mr_get_route() error in rt6_fill_node() Wenbo Sun
2026-11-16 13:54 ` netdev-bot+sashiko [this message]
2026-11-13 2:29 ` [PATCH net-next v2 0/2] ipv6: fix rt6_fill_node() multicast route query handling Hangbin Liu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=179483727608.3136.10892831786069181339@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=1342116488@qq.com \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@kernel.org \
--cc=hangbin.liu@linux.dev \
--cc=horms@kernel.org \
--cc=idosch@nvidia.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liuhangbin@kylinos.cn \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sunwenbo@cmss.chinamobile.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®