patch 'net/iavf: fix memory leak on security context error' has been queued to stable release 23.11.1

Xueming Li xuemingl at nvidia.com
Tue Mar 5 10:45:51 CET 2024


Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. 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=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=3defa10a78b056c43a0ffc585fdac4d4133e6da8

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 3defa10a78b056c43a0ffc585fdac4d4133e6da8 Mon Sep 17 00:00:00 2001
From: Yunjian Wang <wangyunjian at huawei.com>
Date: Fri, 1 Dec 2023 18:46:49 +0800
Subject: [PATCH] net/iavf: fix memory leak on security context error
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit 8758ad5f8633ce4197271d41ece0cc7f799d3d6e ]

In iavf_security_ctx_create() allocated memory for the
'security_ctx', we should free it when memory malloc for
the 'iavf_security_ctx' fails, otherwise it will lead to
memory leak.

Fixes: 6bc987ecb860 ("net/iavf: support IPsec inline crypto")

Signed-off-by: Yunjian Wang <wangyunjian at huawei.com>
Acked-by: Qi Zhang <qi.z.zhang at intel.com>
---
 drivers/net/iavf/iavf_ipsec_crypto.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/iavf/iavf_ipsec_crypto.c b/drivers/net/iavf/iavf_ipsec_crypto.c
index 07a69db540..d6c0180ffd 100644
--- a/drivers/net/iavf/iavf_ipsec_crypto.c
+++ b/drivers/net/iavf/iavf_ipsec_crypto.c
@@ -1518,8 +1518,11 @@ iavf_security_ctx_create(struct iavf_adapter *adapter)
 	if (adapter->security_ctx == NULL) {
 		adapter->security_ctx = rte_malloc("iavf_security_ctx",
 				sizeof(struct iavf_security_ctx), 0);
-		if (adapter->security_ctx == NULL)
+		if (adapter->security_ctx == NULL) {
+			rte_free(adapter->vf.eth_dev->security_ctx);
+			adapter->vf.eth_dev->security_ctx = NULL;
 			return -ENOMEM;
+		}
 	}

 	return 0;
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:31.422786015 +0800
+++ 0010-net-iavf-fix-memory-leak-on-security-context-error.patch	2024-03-05 17:39:30.663566489 +0800
@@ -1 +1 @@
-From 8758ad5f8633ce4197271d41ece0cc7f799d3d6e Mon Sep 17 00:00:00 2001
+From 3defa10a78b056c43a0ffc585fdac4d4133e6da8 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 8758ad5f8633ce4197271d41ece0cc7f799d3d6e ]
@@ -12 +14,0 @@
-Cc: stable at dpdk.org


More information about the stable mailing list