DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: dev@dpdk.org
Cc: Bruce Richardson <bruce.richardson@intel.com>,
	stable@dpdk.org,
	Vladimir Medvedkin <vladimir.medvedkin@intel.com>,
	Abhijit Sinha <abhijit.sinha@intel.com>,
	Jingjing Wu <jingjing.wu@intel.com>,
	Declan Doherty <declan.doherty@intel.com>,
	Radu Nicolau <radu.nicolau@intel.com>
Subject: [PATCH v2 6/6] net/iavf: fix leak of IPsec crypto capabilities array
Date: Fri,  3 Jul 2026 14:19:20 +0100	[thread overview]
Message-ID: <20260703131921.4102325-7-bruce.richardson@intel.com> (raw)
In-Reply-To: <20260703131921.4102325-1-bruce.richardson@intel.com>

The security context setup allocates a crypto capabilities array and
stores it in iavf_sctx->crypto_capabilities. However, the security
context destroy path frees iavf_sctx and sctx directly, without first
freeing that array.

Fix this by freeing iavf_sctx->crypto_capabilities in
iavf_security_ctx_destroy() before freeing the security context itself.

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

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/net/intel/iavf/iavf_ipsec_crypto.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/intel/iavf/iavf_ipsec_crypto.c b/drivers/net/intel/iavf/iavf_ipsec_crypto.c
index b2e08da0aa..9c8f694de5 100644
--- a/drivers/net/intel/iavf/iavf_ipsec_crypto.c
+++ b/drivers/net/intel/iavf/iavf_ipsec_crypto.c
@@ -1572,6 +1572,8 @@ iavf_security_ctx_destroy(struct iavf_adapter *adapter)
 		return -ENODEV;
 
 	/* free and reset security data structures */
+	rte_free(iavf_sctx->crypto_capabilities);
+	iavf_sctx->crypto_capabilities = NULL;
 	rte_free(iavf_sctx);
 	rte_free(sctx);
 
-- 
2.53.0


      parent reply	other threads:[~2026-07-03 13:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-03  8:33 [PATCH 1/2] net/iavf: fix local memory leaks in TM hierarchy commit Bruce Richardson
2026-07-03  8:33 ` [PATCH 2/2] net/iavf: fix leak of queue to traffic class mapping data Bruce Richardson
2026-07-03 13:19 ` [PATCH v2 0/6] Fix some small memory leaks Bruce Richardson
2026-07-03 13:19   ` [PATCH v2 1/6] net/iavf: fix local memory leaks in TM hierarchy commit Bruce Richardson
2026-07-03 13:19   ` [PATCH v2 2/6] net/iavf: fix leak of queue to traffic class mapping data Bruce Richardson
2026-07-03 13:19   ` [PATCH v2 3/6] net/iavf: fix memory leak on error when adding flow parser Bruce Richardson
2026-07-03 13:19   ` [PATCH v2 4/6] net/ice: fix buffer leak in config of Tx queue TM node Bruce Richardson
2026-07-03 13:19   ` [PATCH v2 5/6] net/iavf: fix leak of flex metadata extraction field Bruce Richardson
2026-07-03 13:19   ` Bruce Richardson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260703131921.4102325-7-bruce.richardson@intel.com \
    --to=bruce.richardson@intel.com \
    --cc=abhijit.sinha@intel.com \
    --cc=declan.doherty@intel.com \
    --cc=dev@dpdk.org \
    --cc=jingjing.wu@intel.com \
    --cc=radu.nicolau@intel.com \
    --cc=stable@dpdk.org \
    --cc=vladimir.medvedkin@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox