DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] pipeline: fix IPsec crypto session leak
@ 2023-02-07 18:15 Cristian Dumitrescu
  2023-02-19 22:09 ` Thomas Monjalon
  0 siblings, 1 reply; 2+ messages in thread
From: Cristian Dumitrescu @ 2023-02-07 18:15 UTC (permalink / raw)
  To: dev

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] pipeline: fix IPsec crypto session leak
  2023-02-07 18:15 [PATCH] pipeline: fix IPsec crypto session leak Cristian Dumitrescu
@ 2023-02-19 22:09 ` Thomas Monjalon
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Monjalon @ 2023-02-19 22:09 UTC (permalink / raw)
  To: Cristian Dumitrescu; +Cc: dev

07/02/2023 19:15, Cristian Dumitrescu:
> 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>

Applied, thanks.




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-02-19 22:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-07 18:15 [PATCH] pipeline: fix IPsec crypto session leak Cristian Dumitrescu
2023-02-19 22:09 ` Thomas Monjalon

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).