[dpdk-stable] patch 'security: fix session counter' has been queued to stable release 19.11.3

luca.boccassi at gmail.com luca.boccassi at gmail.com
Tue May 19 15:02:17 CEST 2020


Hi,

FYI, your patch has been queued to stable release 19.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 05/21/20. 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.

Thanks.

Luca Boccassi

---
>From b54822ff2fd386be55dd03ecd32a4609a22ec2d8 Mon Sep 17 00:00:00 2001
From: Lukasz Wojciechowski <l.wojciechow at partner.samsung.com>
Date: Thu, 9 Apr 2020 19:24:52 +0200
Subject: [PATCH] security: fix session counter

[ upstream commit e36b5a87d6d0e1e209d85dc22419924cbe02056c ]

Fix session counter to be decreased in rte_security_session_destroy
only when session was successfully destroyed.

Formerly session counter was decreased prior session destroying
and returning session object to mempool. It remained decreased even
if session was not destroyed and mempool object released making counter
invalid.

Fixes: c261d1431bd8 ("security: introduce security API and framework")

Signed-off-by: Lukasz Wojciechowski <l.wojciechow at partner.samsung.com>
Acked-by: Anoob Joseph <anoobj at marvell.com>
Acked-by: Akhil Goyal <akhil.goyal at nxp.com>
---
 lib/librte_security/rte_security.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/lib/librte_security/rte_security.c b/lib/librte_security/rte_security.c
index 38ccc2ea9c..d475b09771 100644
--- a/lib/librte_security/rte_security.c
+++ b/lib/librte_security/rte_security.c
@@ -90,14 +90,16 @@ rte_security_session_destroy(struct rte_security_ctx *instance,
 			-ENOTSUP);
 	RTE_PTR_OR_ERR_RET(sess, -EINVAL);
 
+	ret = instance->ops->session_destroy(instance->device, sess);
+	if (ret != 0)
+		return ret;
+
+	rte_mempool_put(rte_mempool_from_obj(sess), (void *)sess);
+
 	if (instance->sess_cnt)
 		instance->sess_cnt--;
 
-	ret = instance->ops->session_destroy(instance->device, sess);
-	if (!ret)
-		rte_mempool_put(rte_mempool_from_obj(sess), (void *)sess);
-
-	return ret;
+	return 0;
 }
 
 int
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-05-19 14:04:44.705199725 +0100
+++ 0002-security-fix-session-counter.patch	2020-05-19 14:04:44.048645327 +0100
@@ -1,8 +1,10 @@
-From e36b5a87d6d0e1e209d85dc22419924cbe02056c Mon Sep 17 00:00:00 2001
+From b54822ff2fd386be55dd03ecd32a4609a22ec2d8 Mon Sep 17 00:00:00 2001
 From: Lukasz Wojciechowski <l.wojciechow at partner.samsung.com>
 Date: Thu, 9 Apr 2020 19:24:52 +0200
 Subject: [PATCH] security: fix session counter
 
+[ upstream commit e36b5a87d6d0e1e209d85dc22419924cbe02056c ]
+
 Fix session counter to be decreased in rte_security_session_destroy
 only when session was successfully destroyed.
 
@@ -12,7 +14,6 @@
 invalid.
 
 Fixes: c261d1431bd8 ("security: introduce security API and framework")
-Cc: stable at dpdk.org
 
 Signed-off-by: Lukasz Wojciechowski <l.wojciechow at partner.samsung.com>
 Acked-by: Anoob Joseph <anoobj at marvell.com>


More information about the stable mailing list