DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/mlx5: fix destroying empty matchers list
       [not found] <20220223093205.4240-1-adham@nvidia.com>
@ 2022-02-23  9:32 ` Adham Masarwah
  2022-02-23 10:39   ` Tal Shnaiderman
  2022-03-02 10:20   ` Raslan Darawsheh
  0 siblings, 2 replies; 4+ messages in thread
From: Adham Masarwah @ 2022-02-23  9:32 UTC (permalink / raw)
  To: dev; +Cc: thomas, matan, viacheslavo, talshn, tamerh, erfrimod, stable

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH] net/mlx5: fix destroying empty matchers list
  2022-02-23  9:32 ` [PATCH] net/mlx5: fix destroying empty matchers list Adham Masarwah
@ 2022-02-23 10:39   ` Tal Shnaiderman
       [not found]     ` <CY4PR12MB1270E204766E1F5F930D45E9C9009@CY4PR12MB1270.namprd12.prod.outlook.com>
  2022-03-02 10:20   ` Raslan Darawsheh
  1 sibling, 1 reply; 4+ messages in thread
From: Tal Shnaiderman @ 2022-02-23 10:39 UTC (permalink / raw)
  To: Adham Masarwah, dev
  Cc: NBU-Contact-Thomas Monjalon (EXTERNAL),
	Matan Azrad, Slava Ovsiienko, Tamer Hleihel, erfrimod, stable

> 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>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH] net/mlx5: fix destroying empty matchers list
       [not found]     ` <CY4PR12MB1270E204766E1F5F930D45E9C9009@CY4PR12MB1270.namprd12.prod.outlook.com>
@ 2022-02-27 12:38       ` Idan Hackmon
  0 siblings, 0 replies; 4+ messages in thread
From: Idan Hackmon @ 2022-02-27 12:38 UTC (permalink / raw)
  To: dev
  Cc: NBU-Contact-Thomas Monjalon (EXTERNAL),
	Matan Azrad, Slava Ovsiienko, Tamer Hleihel, erfrimod, stable



> -----Original Message-----
> From: Adham Masarwah <adham@nvidia.com>
> Sent: Sunday, February 27, 2022 2:33 PM
> To: Idan Hackmon <idanhac@nvidia.com>
> Subject: RE: [PATCH] net/mlx5: fix destroying empty matchers list
> 
> > 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>
Tested-by: Idan Hackmon <idanhac@nvidia.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH] net/mlx5: fix destroying empty matchers list
  2022-02-23  9:32 ` [PATCH] net/mlx5: fix destroying empty matchers list Adham Masarwah
  2022-02-23 10:39   ` Tal Shnaiderman
@ 2022-03-02 10:20   ` Raslan Darawsheh
  1 sibling, 0 replies; 4+ messages in thread
From: Raslan Darawsheh @ 2022-03-02 10:20 UTC (permalink / raw)
  To: Adham Masarwah, dev
  Cc: NBU-Contact-Thomas Monjalon (EXTERNAL),
	Matan Azrad, Slava Ovsiienko, Tal Shnaiderman, Tamer Hleihel,
	erfrimod, stable

Hi,

> -----Original Message-----
> From: Adham Masarwah <adham@nvidia.com>
> Sent: Wednesday, February 23, 2022 11:32 AM
> To: dev@dpdk.org
> Cc: NBU-Contact-Thomas Monjalon (EXTERNAL) <thomas@monjalon.net>;
> Matan Azrad <matan@nvidia.com>; Slava Ovsiienko
> <viacheslavo@nvidia.com>; Tal Shnaiderman <talshn@nvidia.com>; Tamer
> Hleihel <tamerh@nvidia.com>; erfrimod@microsoft.com; stable@dpdk.org
> 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>

Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-03-02 10:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20220223093205.4240-1-adham@nvidia.com>
2022-02-23  9:32 ` [PATCH] net/mlx5: fix destroying empty matchers list Adham Masarwah
2022-02-23 10:39   ` Tal Shnaiderman
     [not found]     ` <CY4PR12MB1270E204766E1F5F930D45E9C9009@CY4PR12MB1270.namprd12.prod.outlook.com>
2022-02-27 12:38       ` Idan Hackmon
2022-03-02 10:20   ` Raslan Darawsheh

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).