From: netdev-bot+sashiko@kernel.org
To: sigefriedhyy@gmail.com
Cc: ajay.kathat@microchip.com, aleksandr.loktionov@intel.com,
andrew+netdev@lunn.ch, claudiu.beznea@tuxon.dev,
davem@davemloft.net, dsahern@kernel.org, donald.hunter@gmail.com,
edumazet@google.com, idosch@nvidia.com, jacob.e.keller@intel.com,
kuba@kernel.org, johannes@sipsolutions.net, kees@kernel.org,
kory.maincent@bootlin.com, kuniyu@google.com,
nicolas.dichtel@6wind.com, nickgarlis@gmail.com,
pabeni@redhat.com, sd@queasysnail.net, shuah@kernel.org,
horms@kernel.org, sdf.kernel@gmail.com,
vadim.fedorenko@linux.dev, willemb@google.com,
linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
linux-wireless@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH net-next v9 5/6] netlink: specs: rt-addr: document AF_PACKET multicast dumps
Date: Thu, 01 Oct 2026 23:31:23 +0000 [thread overview]
Message-ID: <179089748368.434549.14167408771777474746@kernel.org> (raw)
In-Reply-To: <20260930112842.21323-6-sigefriedhyy@gmail.com>
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] The patch adds `target-netnsid` to the getmulticast dump request
with no condition, and writes doc text on which request semantics…
Pre-existing issues:
- [Low] In Documentation/netlink/specs/rt-addr.yaml, the getmulticast
operation still has a `do` section, and its doc still starts with "Get…
--
netlink: specs: rt-addr: document AF_PACKET multicast dumps
This updates the rt-addr spec to cover AF_PACKET RTM_GETMULTICAST dumps.
It adds a global ifa-flags value and expands the getmulticast doc. It also
adds flags and target-netnsid to the multicast reply attributes and lists
target-netnsid as a dump request attribute.
> diff --git a/Documentation/netlink/specs/rt-addr.yaml b/Documentation/netlink/specs/rt-addr.yaml
> index 17ead22034515..1bd1184d1e202 100644
> --- a/Documentation/netlink/specs/rt-addr.yaml
> +++ b/Documentation/netlink/specs/rt-addr.yaml
[ ... ]
> @@ -168,7 +170,16 @@ operations:
> attributes: *ifaddr-all
> -
> name: getmulticast
> - doc: Get / dump IPv4/IPv6 multicast addresses.
> + doc: |
> + Get / dump multicast addresses. ifa-family must select the address
> + family: AF_INET or AF_INET6 for the IP multicast groups joined on
> + a device, AF_PACKET for the link-layer multicast addresses in the
> + device filter. Link-layer entries added explicitly, e.g. with
> + SIOCADDMULTI or "bridge fdb add ... self", rather than by a
> + protocol join are reported with the global flag set. For AF_PACKET
> + a non-zero ifa-index restricts the dump to that device and
> + ifa-prefixlen, ifa-flags and ifa-scope must be zero, AF_INET and
> + AF_INET6 apply this with NETLINK_GET_STRICT_CHK only.
> attribute-set: addr-attrs
> fixed-header: ifaddrmsg
> do:
> @@ -181,10 +192,13 @@ operations:
> - multicast
> - mc-users
> - cacheinfo
> + - flags
> + - target-netnsid
[Severity: Low]
This is a pre-existing issue, but does any family actually implement the
do side of getmulticast?
The do block and the "Get / dump" wording were already in the spec before
this patch. Every RTM_GETMULTICAST registration is dump-only:
net/core/rtnetlink.c:
{.protocol = PF_PACKET, .msgtype = RTM_GETMULTICAST,
.dumpit = dev_mc_dump, .flags = RTNL_FLAG_DUMP_UNLOCKED},
net/ipv4/devinet.c:
{.owner = THIS_MODULE, .protocol = PF_INET, .msgtype = RTM_GETMULTICAST,
.dumpit = inet_dump_ifmcaddr, .flags = RTNL_FLAG_DUMP_UNLOCKED},
net/ipv6/addrconf.c:
{.owner = THIS_MODULE, .protocol = PF_INET6, .msgtype = RTM_GETMULTICAST,
.dumpit = inet6_dump_ifmcaddr,
.flags = RTNL_FLAG_DUMP_UNLOCKED},
If NLM_F_DUMP is not set, rtnetlink_rcv_msg() finds no doit for the
family or for PF_UNSPEC and returns -EOPNOTSUPP. A spec-driven do
getmulticast (ynl --do, or the generated C do helper) will therefore
always fail.
The rewritten doc still begins with "Get / dump". The &mcaddr-attrs anchor
is defined under do.reply, so the patch also adds flags and target-netnsid
to the reply of an operation that cannot succeed.
Since this doc is being rewritten anyway, could the do block be dropped,
the attribute list moved under dump.reply, and "Get" removed from the doc?
> dump:
> request:
> value: 58
> - attributes: []
> + attributes:
> + - target-netnsid
[Severity: Low]
Do all three families honour target-netnsid here? The new doc says:
For AF_PACKET
a non-zero ifa-index restricts the dump to that device and
ifa-prefixlen, ifa-flags and ifa-scope must be zero, AF_INET and
AF_INET6 apply this with NETLINK_GET_STRICT_CHK only.
That caveat covers the ifa-index filter and the zero header checks.
However, target-netnsid is listed as a request attribute with no
condition.
For AF_INET, inet_dump_addr() parses IFA_TARGET_NETNSID only through
inet_valid_dump_ifaddr_req(), and only when strict checking is on:
net/ipv4/devinet.c:inet_dump_addr() {
...
if (cb->strict_check) {
err = inet_valid_dump_ifaddr_req(nlh, &fillargs, &tgt_net,
skb->sk, cb);
...
}
inet6_dump_addr() in net/ipv6/addrconf.c does the same with
inet6_valid_dump_ifaddr_req(). On the AF_PACKET side,
dev_mc_valid_dump_req() parses it unconditionally.
As a result, a non-strict AF_INET or AF_INET6 RTM_GETMULTICAST dump that
carries IFA_TARGET_NETNSID ignores the attribute without any error and
dumps the caller's own netns. AF_PACKET honours it.
The C YNL library in tools/net/ynl/lib/ynl.c sets only NETLINK_CAP_ACK
and NETLINK_EXT_ACK and never NETLINK_GET_STRICT_CHK, so spec-driven C
clients will hit this. The Python YNL library does set it.
Could the doc also say that AF_INET and AF_INET6 honour target-netnsid
only with NETLINK_GET_STRICT_CHK?
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260930112842.21323-1-sigefriedhyy%40gmail.com
next prev parent reply other threads:[~2026-10-01 23:31 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-30 11:28 [PATCH net-next v9 0/6] rtnetlink: dump link-layer multicast addresses Yuyang Huang
2026-09-30 11:28 ` [PATCH net-next v9 1/6] netlink: specs: rt-addr: fix the type of target-netnsid Yuyang Huang
2026-10-01 23:31 ` netdev-bot+sashiko
2026-10-02 10:05 ` Yuyang Huang
2026-09-30 11:28 ` [PATCH net-next v9 2/6] net: change netdev_hw_addr_list count through helpers Yuyang Huang
2026-09-30 13:03 ` Nicolas Dichtel
2026-09-30 13:43 ` Yuyang Huang
2026-09-30 14:08 ` Nicolas Dichtel
2026-09-30 14:13 ` Yuyang Huang
2026-10-01 23:31 ` netdev-bot+sashiko
2026-10-02 10:06 ` Yuyang Huang
2026-09-30 11:28 ` [PATCH net-next v9 3/6] net: add a generation counter for dev->mc changes Yuyang Huang
2026-09-30 13:04 ` Nicolas Dichtel
2026-09-30 11:28 ` [PATCH net-next v9 4/6] net: add AF_PACKET multicast dumps Yuyang Huang
2026-10-01 23:31 ` netdev-bot+sashiko
2026-10-02 10:12 ` Yuyang Huang
2026-09-30 11:28 ` [PATCH net-next v9 5/6] netlink: specs: rt-addr: document " Yuyang Huang
2026-10-01 23:31 ` netdev-bot+sashiko [this message]
2026-10-02 10:13 ` Yuyang Huang
2026-09-30 11:28 ` [PATCH net-next v9 6/6] selftests: net: test " Yuyang Huang
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=179089748368.434549.14167408771777474746@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=ajay.kathat@microchip.com \
--cc=aleksandr.loktionov@intel.com \
--cc=andrew+netdev@lunn.ch \
--cc=claudiu.beznea@tuxon.dev \
--cc=davem@davemloft.net \
--cc=donald.hunter@gmail.com \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=idosch@nvidia.com \
--cc=jacob.e.keller@intel.com \
--cc=johannes@sipsolutions.net \
--cc=kees@kernel.org \
--cc=kory.maincent@bootlin.com \
--cc=kuba@kernel.org \
--cc=kuniyu@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nickgarlis@gmail.com \
--cc=nicolas.dichtel@6wind.com \
--cc=pabeni@redhat.com \
--cc=sd@queasysnail.net \
--cc=sdf.kernel@gmail.com \
--cc=shuah@kernel.org \
--cc=sigefriedhyy@gmail.com \
--cc=vadim.fedorenko@linux.dev \
--cc=willemb@google.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®