From: netdev-bot+sashiko@kernel.org
To: bsdhenrymartin@gmail.com
Cc: idosch@nvidia.com, i.maximets@ovn.org, davem@davemloft.net,
kuba@kernel.org, edumazet@kernel.org, pabeni@redhat.com,
andrew@lunn.ch, horms@kernel.org, kuniyu@google.com,
petrm@nvidia.com, ferruh.yigit@amd.com, atenart@redhat.com,
qotmddnjs@gmail.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH net v5 2/2] vxlan: reject VNI add when the default fdb entry is nexthop-backed
Date: Sun, 01 Nov 2026 11:30:30 +0000 [thread overview]
Message-ID: <179353263054.3131.3806722064671880892@kernel.org> (raw)
In-Reply-To: <20261028111626.3460759-2-bsdhenrymartin@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 series order leaves a bisect window, and nothing protects the
stable backport.
- [Low] The commit message gets the order of operations in
vxlan_vni_add() wrong.
--
vxlan: reject VNI add when the default fdb entry is nexthop-backed
This commit adds vxlan_fdb_entry_nh_backed() and calls it from
vxlan_vni_add(). A VNI add with a group, or with a device default remote,
is now rejected when the all-zeros fdb entry for that VNI is backed by a
nexthop. The check runs before the VNI is installed, so a later
-EOPNOTSUPP from vxlan_fdb_update_existing() can no longer leave the VNI
half-installed.
> vxlan_vni_add() installs the new VNI - hash table insert, group list,
> socket attach and the RTM_NEWTUNNEL notification - before calling
> vxlan_vni_update_group(), which in turn calls
> vxlan_update_default_fdb_entry() to store the group (or the device's
> default remote) into the all-zeros fdb entry of that VNI.
[Severity: Low]
Does this ordering match vxlan_vni_add()? In the code, the notification
goes out after vxlan_vni_update_group() returns, and it goes out whatever
the return value is:
err = vxlan_vni_update_group(vxlan, vninode, group, true, &changed,
extack);
vxlan_vnifilter_notify(vxlan, vninode, RTM_NEWTUNNEL);
return err;
The end state described later in the message is accurate: the VNI is
installed and announced despite the error. But it is announced after the
failed update, not before it.
Could this paragraph be reworded to match?
> diff --git a/drivers/net/vxlan/vxlan_vnifilter.c b/drivers/net/vxlan/vxlan_vnifilter.c
> index 124ba47758e91..07e17f4b93530 100644
> --- a/drivers/net/vxlan/vxlan_vnifilter.c
> +++ b/drivers/net/vxlan/vxlan_vnifilter.c
> @@ -837,6 +837,20 @@ static int vxlan_vni_add(struct vxlan_dev *vxlan,
> return err;
> }
>
> + /* A default fdb entry that is backed by a nexthop group can
> + * never take a remote; reject before the VNI is installed,
> + * otherwise a failure in vxlan_vni_update_group() would leave
> + * the VNI half-installed.
> + */
> + if ((group && !vxlan_addr_any(group)) ||
> + !vxlan_addr_any(&cfg->remote_ip)) {
> + if (vxlan_fdb_entry_nh_backed(vxlan, all_zeros_mac, v)) {
> + NL_SET_ERR_MSG(extack,
> + "Cannot add a remote to a nexthop fdb entry");
> + return -EOPNOTSUPP;
> + }
> + }
[Severity: Low]
Does the series order leave a bisect window between this patch and the
earlier "vxlan: reject adding a remote to a nexthop fdb entry"?
That earlier patch adds this check to vxlan_fdb_update_existing():
if (rcu_access_pointer(f->nh) &&
(flags & NLM_F_APPEND) &&
(is_multicast_ether_addr(f->key.eth_addr) ||
is_zero_ether_addr(f->key.eth_addr))) {
NL_SET_ERR_MSG(extack,
"Cannot add a remote to a nexthop fdb entry");
return -EOPNOTSUPP;
}
With only that patch applied, a sequence like this:
bridge fdb add 00:00:00:00:00:00 dev vx0 nhid X self permanent src_vni N
bridge vni add dev vx0 vni N group G
goes through this path:
vxlan_vni_add()
vxlan_vni_update_group()
vxlan_update_default_fdb_entry()
vxlan_fdb_update()
vxlan_fdb_update_existing() returns -EOPNOTSUPP
By then the VNI is already in the hash table and the group list, and
RTM_NEWTUNNEL is still sent. That is the half-installed state this patch
is meant to prevent. Leaving out the group has the same effect when the
device has a default remote. Before the earlier patch, the same request
succeeded and appended a stray remote.
Both patches carry Cc: stable and the same Fixes: tag, but neither one
records the dependency.
The earlier patch only touches vxlan_fdb_update_existing(), so it will
probably apply cleanly to older trees. This patch was reworked in v5 for
the RCU conversion of vxlan->cfg (the local cfg from
rtnl_dereference(vxlan->cfg)), so its context is unlikely to apply there.
Could stable end up taking the earlier patch on its own? This guard does
not depend on the earlier patch, so would it make sense to put it first
in the series, or to squash the two?
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261028111626.3460759-1-bsdhenrymartin%40gmail.com
next prev parent reply other threads:[~2026-11-01 11:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-28 11:16 [PATCH net v5 1/2] vxlan: reject adding a remote to a nexthop fdb entry Henry Martin
2026-10-28 11:16 ` [PATCH net v5 2/2] vxlan: reject VNI add when the default fdb entry is nexthop-backed Henry Martin
2026-11-01 11:30 ` netdev-bot+sashiko [this message]
2026-10-29 9:11 ` [PATCH net v5 1/2] vxlan: reject adding a remote to a nexthop fdb entry Ido Schimmel
2026-11-01 11:30 ` netdev-bot+sashiko
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=179353263054.3131.3806722064671880892@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=andrew@lunn.ch \
--cc=atenart@redhat.com \
--cc=bsdhenrymartin@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=ferruh.yigit@amd.com \
--cc=horms@kernel.org \
--cc=i.maximets@ovn.org \
--cc=idosch@nvidia.com \
--cc=kuba@kernel.org \
--cc=kuniyu@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=petrm@nvidia.com \
--cc=qotmddnjs@gmail.com \
--cc=stable@vger.kernel.org \
/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®