[dpdk-stable] patch 'net/mlx5: fix using flow tunnel before null check' has been queued to stable release 20.11.2

Xueming Li xuemingl at nvidia.com
Mon May 10 18:01:07 CEST 2021


Hi,

FYI, your patch has been queued to stable release 20.11.2

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/12/21. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/steevenlee/dpdk

This queued commit can be viewed at:
https://github.com/steevenlee/dpdk/commit/f90c6e9d4139a54551d6487b72ec851cdf5fabfa

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From f90c6e9d4139a54551d6487b72ec851cdf5fabfa Mon Sep 17 00:00:00 2001
From: Yunjian Wang <wangyunjian at huawei.com>
Date: Sat, 27 Mar 2021 10:44:09 +0800
Subject: [PATCH] net/mlx5: fix using flow tunnel before null check
Cc: Luca Boccassi <bluca at debian.org>

[ upstream commit ed9726ce83eb7562b3dcfaf0ee10647ed816ae4a ]

Coverity flags that 'ctx->tunnel' variable is used before
it's checked for NULL. This patch fixes this issue.

Coverity issue: 366201
Fixes: 868d2e342cf3 ("net/mlx5: fix tunnel offload hub multi-thread protection")

Signed-off-by: Yunjian Wang <wangyunjian at huawei.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo at nvidia.com>
---
 drivers/net/mlx5/mlx5_flow.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index d574ad78c7..2fe810c6b5 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -7609,10 +7609,11 @@ static void get_tunnel_miss(struct rte_eth_dev *dev, void *x)
 
 	rte_spinlock_unlock(&thub->sl);
 	ctx->tunnel = mlx5_flow_tunnel_allocate(dev, ctx->app_tunnel);
-	ctx->tunnel->refctn = 1;
 	rte_spinlock_lock(&thub->sl);
-	if (ctx->tunnel)
+	if (ctx->tunnel) {
+		ctx->tunnel->refctn = 1;
 		LIST_INSERT_HEAD(&thub->tunnels, ctx->tunnel, chain);
+	}
 }
 
 
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-05-10 23:59:29.674522700 +0800
+++ 0119-net-mlx5-fix-using-flow-tunnel-before-null-check.patch	2021-05-10 23:59:26.520000000 +0800
@@ -1 +1 @@
-From ed9726ce83eb7562b3dcfaf0ee10647ed816ae4a Mon Sep 17 00:00:00 2001
+From f90c6e9d4139a54551d6487b72ec851cdf5fabfa Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Luca Boccassi <bluca at debian.org>
+
+[ upstream commit ed9726ce83eb7562b3dcfaf0ee10647ed816ae4a ]
@@ -11 +13,0 @@
-Cc: stable at dpdk.org
@@ -20 +22 @@
-index 7ab7f63264..c347f8130e 100644
+index d574ad78c7..2fe810c6b5 100644
@@ -23 +25 @@
-@@ -7881,10 +7881,11 @@ static void get_tunnel_miss(struct rte_eth_dev *dev, void *x)
+@@ -7609,10 +7609,11 @@ static void get_tunnel_miss(struct rte_eth_dev *dev, void *x)


More information about the stable mailing list