patch 'pipeline: fix double free for table stats' has been queued to stable release 22.11.3

Xueming Li xuemingl at nvidia.com
Sun Jun 25 08:33:48 CEST 2023


Hi,

FYI, your patch has been queued to stable release 22.11.3

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 06/27/23. 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://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=22.11-staging&id=2d3c4df8f53c505bb3dfd31311bf86fb9af5a4af

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 2d3c4df8f53c505bb3dfd31311bf86fb9af5a4af Mon Sep 17 00:00:00 2001
From: Kamalakannan R <kamalakannan.r at intel.com>
Date: Mon, 17 Apr 2023 16:52:43 +0530
Subject: [PATCH] pipeline: fix double free for table stats
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit 2d9e10932d535ea553081b489a25f6fce7ec7996 ]

The pointer to the table statistics data structure needs to be set
to NULL after free inside the table_build_free(), as this function is
called from multiple places, leading to double memory free error.

Similar fix for the learner_build_free() function.

Fixes: 742b0a57f50e ("pipeline: add table statistics to SWX")
Fixes: 4f59d3726147 ("pipeline: support learner tables")

Signed-off-by: Kamalakannan R <kamalakannan.r at intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu at intel.com>
---
 lib/pipeline/rte_swx_pipeline.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/pipeline/rte_swx_pipeline.c b/lib/pipeline/rte_swx_pipeline.c
index 0e631dea2b..084c614639 100644
--- a/lib/pipeline/rte_swx_pipeline.c
+++ b/lib/pipeline/rte_swx_pipeline.c
@@ -8450,6 +8450,7 @@ table_build_free(struct rte_swx_pipeline *p)
 			free(p->table_stats[i].n_pkts_action);
 
 		free(p->table_stats);
+		p->table_stats = NULL;
 	}
 }
 
@@ -9364,6 +9365,7 @@ learner_build_free(struct rte_swx_pipeline *p)
 			free(p->learner_stats[i].n_pkts_action);
 
 		free(p->learner_stats);
+		p->learner_stats = NULL;
 	}
 }
 
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-06-25 14:31:58.859207400 +0800
+++ 0010-pipeline-fix-double-free-for-table-stats.patch	2023-06-25 14:31:58.295773900 +0800
@@ -1 +1 @@
-From 2d9e10932d535ea553081b489a25f6fce7ec7996 Mon Sep 17 00:00:00 2001
+From 2d3c4df8f53c505bb3dfd31311bf86fb9af5a4af Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 2d9e10932d535ea553081b489a25f6fce7ec7996 ]
@@ -14 +16,0 @@
-Cc: stable at dpdk.org
@@ -23 +25 @@
-index dea1378095..da37eda231 100644
+index 0e631dea2b..084c614639 100644
@@ -26 +28 @@
-@@ -8665,6 +8665,7 @@ table_build_free(struct rte_swx_pipeline *p)
+@@ -8450,6 +8450,7 @@ table_build_free(struct rte_swx_pipeline *p)
@@ -34 +36 @@
-@@ -9579,6 +9580,7 @@ learner_build_free(struct rte_swx_pipeline *p)
+@@ -9364,6 +9365,7 @@ learner_build_free(struct rte_swx_pipeline *p)


More information about the stable mailing list