DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/mlx5: fix segfault on close after failed start
@ 2021-11-23 20:22 Dmitry Kozlyuk
  2021-11-23 22:39 ` Raslan Darawsheh
  0 siblings, 1 reply; 2+ messages in thread
From: Dmitry Kozlyuk @ 2021-11-23 20:22 UTC (permalink / raw)
  To: dev; +Cc: Raslan Darawsheh, xuemingl, Matan Azrad, Viacheslav Ovsiienko

If mlx5_rxq_start() failed and rxq_ctrl was not initialized,
mlx5_rxq_obj_verify() would segfaul in an attempt to dereference it.
Add a check that rxq_ctrl is not NULL before accessing its members.

Fixes: 09c2555303be ("net/mlx5: support shared Rx queue")
Cc: xuemingl@nvidia.com

Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/net/mlx5/mlx5_rxq.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index 480f4f9f07..dd15e158b4 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -1271,6 +1271,8 @@ mlx5_rxq_obj_verify(struct rte_eth_dev *dev)
 	struct mlx5_rxq_obj *rxq_obj;
 
 	LIST_FOREACH(rxq_obj, &priv->rxqsobj, next) {
+		if (rxq_obj->rxq_ctrl == NULL)
+			continue;
 		if (rxq_obj->rxq_ctrl->rxq.shared &&
 		    !LIST_EMPTY(&rxq_obj->rxq_ctrl->owners))
 			continue;
-- 
2.25.1


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

* RE: [PATCH] net/mlx5: fix segfault on close after failed start
  2021-11-23 20:22 [PATCH] net/mlx5: fix segfault on close after failed start Dmitry Kozlyuk
@ 2021-11-23 22:39 ` Raslan Darawsheh
  0 siblings, 0 replies; 2+ messages in thread
From: Raslan Darawsheh @ 2021-11-23 22:39 UTC (permalink / raw)
  To: Dmitry Kozlyuk, dev; +Cc: Xueming(Steven) Li, Matan Azrad, Slava Ovsiienko

Hi,

> -----Original Message-----
> From: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
> Sent: Tuesday, November 23, 2021 10:22 PM
> To: dev@dpdk.org
> Cc: Raslan Darawsheh <rasland@nvidia.com>; Xueming(Steven) Li
> <xuemingl@nvidia.com>; Matan Azrad <matan@nvidia.com>; Slava Ovsiienko
> <viacheslavo@nvidia.com>
> Subject: [PATCH] net/mlx5: fix segfault on close after failed start
> 
> If mlx5_rxq_start() failed and rxq_ctrl was not initialized,
> mlx5_rxq_obj_verify() would segfaul in an attempt to dereference it.
> Add a check that rxq_ctrl is not NULL before accessing its members.
> 
> Fixes: 09c2555303be ("net/mlx5: support shared Rx queue")
> Cc: xuemingl@nvidia.com
> 
> Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
> Acked-by: Matan Azrad <matan@nvidia.com>
> ---
Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh

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

end of thread, other threads:[~2021-11-23 22:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-23 20:22 [PATCH] net/mlx5: fix segfault on close after failed start Dmitry Kozlyuk
2021-11-23 22:39 ` 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).