patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Tal Shnaiderman <talshn@nvidia.com>
To: Adham Masarwah <adham@nvidia.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "NBU-Contact-Thomas Monjalon (EXTERNAL)" <thomas@monjalon.net>,
	Matan Azrad <matan@nvidia.com>,
	Slava Ovsiienko <viacheslavo@nvidia.com>,
	Tamer Hleihel <tamerh@nvidia.com>,
	"erfrimod@microsoft.com" <erfrimod@microsoft.com>,
	"stable@dpdk.org" <stable@dpdk.org>
Subject: RE: [PATCH] net/mlx5: fix destroying empty matchers list
Date: Wed, 23 Feb 2022 10:39:40 +0000	[thread overview]
Message-ID: <DM4PR12MB5389C7492509E51F55B6D051A43C9@DM4PR12MB5389.namprd12.prod.outlook.com> (raw)
In-Reply-To: <20220223093205.4240-2-adham@nvidia.com>

> Subject: [PATCH] net/mlx5: fix destroying empty matchers list
> 
> The table remove callback function is trying to destroy the matchers list
> associated with table entries without checking if the list is valid, which causes
> nullptr dereference.
> Fixed by validating the matchers list before destroying it.
> 
> Issue can be reproduced with testpmd on Windows, when you run:
> port close all
> 
> Fixes: 1872635570be ("net/mlx5: make matcher list thread safe")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Adham Masarwah <adham@nvidia.com>
> Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
> ---
>  drivers/net/mlx5/mlx5_flow_dv.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/mlx5/mlx5_flow_dv.c
> b/drivers/net/mlx5/mlx5_flow_dv.c index ef9c66eddf..baef252a7a 100644
> --- a/drivers/net/mlx5/mlx5_flow_dv.c
> +++ b/drivers/net/mlx5/mlx5_flow_dv.c
> @@ -10503,7 +10503,8 @@ flow_dv_tbl_remove_cb(void *tool_ctx, struct
> mlx5_list_entry *entry)
>  			tbl_data->tunnel->tunnel_id : 0,
>  			tbl_data->group_id);
>  	}
> -	mlx5_list_destroy(tbl_data->matchers);
> +	if (tbl_data->matchers)
> +		mlx5_list_destroy(tbl_data->matchers);
>  	mlx5_ipool_free(sh->ipool[MLX5_IPOOL_JUMP], tbl_data->idx);  }
> 
> --
> 2.16.1.windows.4

Acked-by: Tal Shnaiderman <talshn@nvidia.com>

  reply	other threads:[~2022-02-23 10:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20220223093205.4240-1-adham@nvidia.com>
2022-02-23  9:32 ` Adham Masarwah
2022-02-23 10:39   ` Tal Shnaiderman [this message]
     [not found]     ` <CY4PR12MB1270E204766E1F5F930D45E9C9009@CY4PR12MB1270.namprd12.prod.outlook.com>
2022-02-27 12:38       ` Idan Hackmon
2022-03-02 10:20   ` Raslan Darawsheh

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=DM4PR12MB5389C7492509E51F55B6D051A43C9@DM4PR12MB5389.namprd12.prod.outlook.com \
    --to=talshn@nvidia.com \
    --cc=adham@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=erfrimod@microsoft.com \
    --cc=matan@nvidia.com \
    --cc=stable@dpdk.org \
    --cc=tamerh@nvidia.com \
    --cc=thomas@monjalon.net \
    --cc=viacheslavo@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;
as well as URLs for NNTP newsgroup(s).