The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Moshe Shemesh <moshe@nvidia.com>
To: Prathamesh Deshpande <prathameshdeshpande7@gmail.com>,
	Saeed Mahameed <saeedm@nvidia.com>,
	Leon Romanovsky <leon@kernel.org>
Cc: Tariq Toukan <tariqt@nvidia.com>,
	Yevgeny Kliteynik <kliteyn@nvidia.com>,
	Jakub Kicinski <kuba@kernel.org>, <netdev@vger.kernel.org>,
	<linux-rdma@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net v1] net/mlx5: Fix HWS action unwind NULL dereference
Date: Thu, 7 May 2026 13:55:24 +0300	[thread overview]
Message-ID: <1d7235ce-8354-44bd-8f2d-fb3eca35bb65@nvidia.com> (raw)
In-Reply-To: <20260504220725.46686-1-prathameshdeshpande7@gmail.com>



On 5/5/2026 1:06 AM, Prathamesh Deshpande wrote:
> mlx5_fs_fte_get_hws_actions() stores some destination actions in
> fs_actions[] before checking whether action creation succeeded.
> 
> If creating a table-number or range destination action fails, or if
> fetching a sampler destination action fails, dest_action is NULL but
> num_fs_actions has already been incremented. The shared error path then
> calls mlx5_fs_destroy_fs_action(), which dereferences fs_action->action
> to get the HWS action type, causing a NULL pointer dereference while
> unwinding the original failure.
> 
> Track whether the current destination action needs fs_actions[] cleanup,
> but append it only after dest_action has been validated.
> 
> Fixes: 2ec6786ad0a6b ("net/mlx5: fs, add HWS fte API functions")
> Fixes: 32e658c84b6d ("net/mlx5: fs, add support for dest flow sampler HWS action")
> Signed-off-by: Prathamesh Deshpande<prathameshdeshpande7@gmail.com>

Acked-by: Moshe Shemesh <moshe@nvidia.com>

> ---
>   .../mellanox/mlx5/core/steering/hws/fs_hws.c     | 16 +++++++++++-----
>   1 file changed, 11 insertions(+), 5 deletions(-)


  reply	other threads:[~2026-05-07 10:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-04 22:06 [PATCH net v1] net/mlx5: Fix HWS action unwind NULL dereference Prathamesh Deshpande
2026-05-07 10:55 ` Moshe Shemesh [this message]
2026-05-08  8:53 ` Simon Horman

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=1d7235ce-8354-44bd-8f2d-fb3eca35bb65@nvidia.com \
    --to=moshe@nvidia.com \
    --cc=kliteyn@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=prathameshdeshpande7@gmail.com \
    --cc=saeedm@nvidia.com \
    --cc=tariqt@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