[dpdk-dev] [PATCH v2 3/3] net/iavf: set pointer to NULL after free

Yunjian Wang wangyunjian at huawei.com
Tue Feb 15 14:02:27 CET 2022


When iavf_security_ctx_destroy() is cleaning up, it does not correctly
set the security_ctx variable to NULL, which will lead to wild pointer.

Fixes: 6bc987ecb860 ("net/iavf: support IPsec inline crypto")
Cc: stable at dpdk.org

Signed-off-by: Yunjian Wang <wangyunjian at huawei.com>
---
 drivers/net/iavf/iavf_ipsec_crypto.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/iavf/iavf_ipsec_crypto.c b/drivers/net/iavf/iavf_ipsec_crypto.c
index 6ac1b213db..a63e42f29a 100644
--- a/drivers/net/iavf/iavf_ipsec_crypto.c
+++ b/drivers/net/iavf/iavf_ipsec_crypto.c
@@ -1553,8 +1553,8 @@ iavf_security_ctx_destroy(struct iavf_adapter *adapter)
 	rte_free(iavf_sctx);
 	rte_free(sctx);
 
-	iavf_sctx = NULL;
-	sctx = NULL;
+	adapter->security_ctx = NULL;
+	adapter->vf.eth_dev->security_ctx = NULL;
 
 	return 0;
 }
-- 
2.27.0



More information about the stable mailing list