patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH] security: fix segfault when destroy NULL session
@ 2018-07-05 10:04 Radu Nicolau
  2018-07-05 10:51 ` [dpdk-stable] [dpdk-dev] " Akhil Goyal
  0 siblings, 1 reply; 3+ messages in thread
From: Radu Nicolau @ 2018-07-05 10:04 UTC (permalink / raw)
  To: dev; +Cc: akhil.goyal, borisp, declan.doherty, Radu Nicolau, stable

rte_security_session_destroy should return -EINVAL is session is NULL,
but segfaults because of rte_mempool_from_obj(NULL) call.

Fixes: c261d1431bd8 ("security: introduce security API and framework")
Cc: stable@dpdk.org

Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
---
 lib/librte_security/rte_security.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lib/librte_security/rte_security.c b/lib/librte_security/rte_security.c
index 1e559c9..f862e94 100644
--- a/lib/librte_security/rte_security.c
+++ b/lib/librte_security/rte_security.c
@@ -91,7 +91,6 @@ rte_security_session_destroy(struct rte_security_ctx *instance,
 			     struct rte_security_session *sess)
 {
 	int ret;
-	struct rte_mempool *mp = rte_mempool_from_obj(sess);
 
 	RTE_FUNC_PTR_OR_ERR_RET(*instance->ops->session_destroy, -ENOTSUP);
 
@@ -100,7 +99,7 @@ rte_security_session_destroy(struct rte_security_ctx *instance,
 
 	ret = instance->ops->session_destroy(instance->device, sess);
 	if (!ret)
-		rte_mempool_put(mp, (void *)sess);
+		rte_mempool_put(rte_mempool_from_obj(sess), (void *)sess);
 
 	return ret;
 }
-- 
2.7.5

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

* Re: [dpdk-stable] [dpdk-dev] [PATCH] security: fix segfault when destroy NULL session
  2018-07-05 10:04 [dpdk-stable] [PATCH] security: fix segfault when destroy NULL session Radu Nicolau
@ 2018-07-05 10:51 ` Akhil Goyal
  2018-07-05 16:14   ` De Lara Guarch, Pablo
  0 siblings, 1 reply; 3+ messages in thread
From: Akhil Goyal @ 2018-07-05 10:51 UTC (permalink / raw)
  To: Radu Nicolau, dev; +Cc: borisp, declan.doherty, stable


On 7/5/2018 3:34 PM, Radu Nicolau wrote:

> rte_security_session_destroy should return -EINVAL is session is NULL,
> but segfaults because of rte_mempool_from_obj(NULL) call.
>
> Fixes: c261d1431bd8 ("security: introduce security API and framework")
> Cc: stable@dpdk.org
>
> Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
> ---

Acked-by: Akhil Goyal <akhil.goyal@nxp.com>

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

* Re: [dpdk-stable] [dpdk-dev] [PATCH] security: fix segfault when destroy NULL session
  2018-07-05 10:51 ` [dpdk-stable] [dpdk-dev] " Akhil Goyal
@ 2018-07-05 16:14   ` De Lara Guarch, Pablo
  0 siblings, 0 replies; 3+ messages in thread
From: De Lara Guarch, Pablo @ 2018-07-05 16:14 UTC (permalink / raw)
  To: Akhil Goyal, Nicolau, Radu, dev; +Cc: borisp, Doherty, Declan, stable



> -----Original Message-----
> From: stable [mailto:stable-bounces@dpdk.org] On Behalf Of Akhil Goyal
> Sent: Thursday, July 5, 2018 11:52 AM
> To: Nicolau, Radu <radu.nicolau@intel.com>; dev@dpdk.org
> Cc: borisp@mellanox.com; Doherty, Declan <declan.doherty@intel.com>;
> stable@dpdk.org
> Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH] security: fix segfault when
> destroy NULL session
> 
> 
> On 7/5/2018 3:34 PM, Radu Nicolau wrote:
> 
> > rte_security_session_destroy should return -EINVAL is session is NULL,
> > but segfaults because of rte_mempool_from_obj(NULL) call.
> >
> > Fixes: c261d1431bd8 ("security: introduce security API and framework")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
> > ---
> 
> Acked-by: Akhil Goyal <akhil.goyal@nxp.com>

Applied to dpdk-next-crypto.
Thanks,

Pablo

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

end of thread, other threads:[~2018-07-05 16:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-05 10:04 [dpdk-stable] [PATCH] security: fix segfault when destroy NULL session Radu Nicolau
2018-07-05 10:51 ` [dpdk-stable] [dpdk-dev] " Akhil Goyal
2018-07-05 16:14   ` De Lara Guarch, Pablo

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