From: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
To: dev@dpdk.org
Subject: [PATCH] pipeline: fix IPsec crypto session leak
Date: Tue, 7 Feb 2023 18:15:42 +0000 [thread overview]
Message-ID: <20230207181542.655091-1-cristian.dumitrescu@intel.com> (raw)
In case of rte_ipsec_session_prepare() error, the crypto session was
not freed, leading to its leakage.
Fixes: 20777eb5f913 ("pipeline: add IPsec")
Coverity issue: 383139
Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
---
lib/pipeline/rte_swx_ipsec.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/lib/pipeline/rte_swx_ipsec.c b/lib/pipeline/rte_swx_ipsec.c
index b23056e23e..6c217ee797 100644
--- a/lib/pipeline/rte_swx_ipsec.c
+++ b/lib/pipeline/rte_swx_ipsec.c
@@ -1719,7 +1719,11 @@ ipsec_session_create(struct rte_swx_ipsec *ipsec,
s->pkt_func.prepare.async = NULL;
s->pkt_func.process = NULL;
- return rte_ipsec_session_prepare(s);
+ status = rte_ipsec_session_prepare(s);
+ if (status)
+ goto error;
+
+ return 0;
error:
/* sa. */
--
2.34.1
next reply other threads:[~2023-02-07 18:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-07 18:15 Cristian Dumitrescu [this message]
2023-02-19 22:09 ` Thomas Monjalon
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=20230207181542.655091-1-cristian.dumitrescu@intel.com \
--to=cristian.dumitrescu@intel.com \
--cc=dev@dpdk.org \
/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;
as well as URLs for NNTP newsgroup(s).