From: Tariq Toukan <tariqt@nvidia.com>
To: Changyul Lee <lcy8047@gmail.com>,
Saeed Mahameed <saeedm@nvidia.com>,
Leon Romanovsky <leon@kernel.org>,
Tariq Toukan <tariqt@nvidia.com>, Mark Bloch <mbloch@nvidia.com>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>,
"David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Moshe Shemesh <moshe@nvidia.com>, Aya Levin <ayal@nvidia.com>,
netdev@vger.kernel.org, linux-rdma@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net] net/mlx5e: Hold sync_lock while resetting VXLAN ports
Date: Wed, 18 Nov 2026 13:26:15 +0200 [thread overview]
Message-ID: <2c11ca60-b1c7-45be-94dd-b0fb648109e1@nvidia.com> (raw)
In-Reply-To: <20261113040323.2090829-1-lcy8047@gmail.com>
On 13/11/2026 6:03, Changyul Lee wrote:
> mlx5_vxlan_reset_to_default() walks vxlan->htable without sync_lock
> and calls mlx5_vxlan_del_port() for each user port. mlx5e_nic_disable()
> and mlx5e_uplink_rep_disable() call it after rtnl_unlock(), so the
> udp_tunnel_nic work can run mlx5e_vxlan_unset_port() at the same time.
> If that removes and frees the entry saved as the next one in
> hash_for_each_safe(), the walk then reads freed memory.
>
> Hold sync_lock over the whole walk, and add __mlx5_vxlan_del_port() for
> callers that already hold it.
>
> Fixes: c5eb51adf06b ("net/mlx5e: Fix VXLAN synchronization after function reload")
> Signed-off-by: Changyul Lee <lcy8047@gmail.com>
> ---
> Found with a static analysis tool we are developing.
>
> Compile-tested only, with x86_64_defconfig plus MLX5_CORE_EN and W=1.
>
> .../ethernet/mellanox/mlx5/core/lib/vxlan.c | 24 ++++++++++++-------
> 1 file changed, 15 insertions(+), 9 deletions(-)
>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Thanks.
prev parent reply other threads:[~2026-11-18 11:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-13 4:03 [PATCH net] net/mlx5e: Hold sync_lock while resetting VXLAN ports Changyul Lee
2026-11-18 11:26 ` Tariq Toukan [this message]
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=2c11ca60-b1c7-45be-94dd-b0fb648109e1@nvidia.com \
--to=tariqt@nvidia.com \
--cc=andrew+netdev@lunn.ch \
--cc=ayal@nvidia.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=kuba@kernel.org \
--cc=lcy8047@gmail.com \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=mbloch@nvidia.com \
--cc=moshe@nvidia.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=saeedm@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox