All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ido Schimmel <idosch@nvidia.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: netdev@vger.kernel.org, davem@davemloft.net, pabeni@redhat.com,
	edumazet@google.com, andrew+netdev@lunn.ch, razor@blackwall.org,
	petrm@nvidia.com, roopa@nvidia.com
Subject: Re: [PATCH net] vxlan: vnifilter: Fix unlocked deletion of default FDB entry
Date: Thu, 24 Apr 2025 09:17:34 +0300	[thread overview]
Message-ID: <aAnXfryT1sYcE7-m@shredder> (raw)
In-Reply-To: <20250423142921.089e58cf@kernel.org>

On Wed, Apr 23, 2025 at 02:29:21PM -0700, Jakub Kicinski wrote:
> On Wed, 23 Apr 2025 17:51:31 +0300 Ido Schimmel wrote:
> > I'm sorry, but I only noticed this issue after the recent VXLAN patches
> > were applied to net-next. There will be a conflict when merging net into
> > net-next, but resolution is trivial. Reference:
> > https://github.com/idosch/linux/commit/ed95370ec89cccbf784d5ef5ea4b6fb6fa0daf47.patch
> 
> Thanks! I guess this shouldn't happen often but FWIW for conflict-less
> build breakage a patch on top of the merge would be more convenient
> than the net-next version of the patch. Like this:

No problem, but note that "hash_index" needs to be removed as well, so
this would be the diff:

diff --git a/drivers/net/vxlan/vxlan_vnifilter.c b/drivers/net/vxlan/vxlan_vnifilter.c
index 81d088c2f8dc..186d0660669a 100644
--- a/drivers/net/vxlan/vxlan_vnifilter.c
+++ b/drivers/net/vxlan/vxlan_vnifilter.c
@@ -625,10 +625,7 @@ static void vxlan_vni_delete_group(struct vxlan_dev *vxlan,
 	 */
 	if (!vxlan_addr_any(&vninode->remote_ip) ||
 	    !vxlan_addr_any(&dst->remote_ip)) {
-		u32 hash_index = fdb_head_index(vxlan, all_zeros_mac,
-						vninode->vni);
-
-		spin_lock_bh(&vxlan->hash_lock[hash_index]);
+		spin_lock_bh(&vxlan->hash_lock);
 		__vxlan_fdb_delete(vxlan, all_zeros_mac,
 				   (vxlan_addr_any(&vninode->remote_ip) ?
 				   dst->remote_ip : vninode->remote_ip),
@@ -636,7 +633,7 @@ static void vxlan_vni_delete_group(struct vxlan_dev *vxlan,
 				   vninode->vni, vninode->vni,
 				   dst->remote_ifindex,
 				   true);
-		spin_unlock_bh(&vxlan->hash_lock[hash_index]);
+		spin_unlock_bh(&vxlan->hash_lock);
 	}
 
 	if (vxlan->dev->flags & IFF_UP) {

  reply	other threads:[~2025-04-24  6:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-23 14:51 [PATCH net] vxlan: vnifilter: Fix unlocked deletion of default FDB entry Ido Schimmel
2025-04-23 14:58 ` Nikolay Aleksandrov
2025-04-23 21:29 ` Jakub Kicinski
2025-04-24  6:17   ` Ido Schimmel [this message]
2025-04-24 18:20 ` patchwork-bot+netdevbpf

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=aAnXfryT1sYcE7-m@shredder \
    --to=idosch@nvidia.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=petrm@nvidia.com \
    --cc=razor@blackwall.org \
    --cc=roopa@nvidia.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.