DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] crypto: fix null pointer dereferencing
@ 2016-05-23 15:46 Deepak Kumar Jain
  2016-06-02 13:58 ` De Lara Guarch, Pablo
  2016-06-07  9:36 ` [dpdk-dev] [PATCH v2] aesni_mb: " Jain, Deepak K
  0 siblings, 2 replies; 5+ messages in thread
From: Deepak Kumar Jain @ 2016-05-23 15:46 UTC (permalink / raw)
  To: declan.doherty; +Cc: deepak.k.jain, dev

From: "Jain, Deepak K" <deepak.k.jain@intel.com>

Fix null pointer dereferencing by reporing if null and
exiting the function.

Fixes: c0f87eb5252b ("cryptodev: change burst API to be crypto op oriented")
Coverity issue: 126584

Signed-off-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
---
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c
index 9c42f88..31784e1 100644
--- a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c
+++ b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c
@@ -379,9 +379,11 @@ process_crypto_op(struct aesni_mb_qp *qp, struct rte_crypto_op *op,
 		/* append space for output data to mbuf */
 		char *odata = rte_pktmbuf_append(m_dst,
 				rte_pktmbuf_data_len(op->sym->m_src));
-		if (odata == NULL)
+		if (odata == NULL) {
 			MB_LOG_ERR("failed to allocate space in destination "
 					"mbuf for source data");
+			return NULL;
+		}
 
 		memcpy(odata, rte_pktmbuf_mtod(op->sym->m_src, void*),
 				rte_pktmbuf_data_len(op->sym->m_src));
-- 
2.5.5

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

* Re: [dpdk-dev] [PATCH] crypto: fix null pointer dereferencing
  2016-05-23 15:46 [dpdk-dev] [PATCH] crypto: fix null pointer dereferencing Deepak Kumar Jain
@ 2016-06-02 13:58 ` De Lara Guarch, Pablo
  2016-06-07  9:36 ` [dpdk-dev] [PATCH v2] aesni_mb: " Jain, Deepak K
  1 sibling, 0 replies; 5+ messages in thread
From: De Lara Guarch, Pablo @ 2016-06-02 13:58 UTC (permalink / raw)
  To: Jain, Deepak K, Doherty, Declan; +Cc: Jain, Deepak K, dev

Hi Deepak,

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Deepak Kumar Jain
> Sent: Monday, May 23, 2016 4:47 PM
> To: Doherty, Declan
> Cc: Jain, Deepak K; dev@dpdk.org
> Subject: [dpdk-dev] [PATCH] crypto: fix null pointer dereferencing
> 
> From: "Jain, Deepak K" <deepak.k.jain@intel.com>
> 
> Fix null pointer dereferencing by reporing if null and
> exiting the function.
> 
> Fixes: c0f87eb5252b ("cryptodev: change burst API to be crypto op oriented")
> Coverity issue: 126584
> 
> Signed-off-by: Deepak Kumar Jain <deepak.k.jain@intel.com>

Could you change the title to "aesni_mb: fix null pointer dereferencing",
to specify that the patch is for the aesni mb pmd?

Thanks,
Pablo

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

* [dpdk-dev] [PATCH v2] aesni_mb: fix null pointer dereferencing
  2016-05-23 15:46 [dpdk-dev] [PATCH] crypto: fix null pointer dereferencing Deepak Kumar Jain
  2016-06-02 13:58 ` De Lara Guarch, Pablo
@ 2016-06-07  9:36 ` Jain, Deepak K
  2016-06-07 11:04   ` De Lara Guarch, Pablo
  1 sibling, 1 reply; 5+ messages in thread
From: Jain, Deepak K @ 2016-06-07  9:36 UTC (permalink / raw)
  To: dev; +Cc: declan.doherty, deepak.k.jain

Fix null pointer dereferencing by reporing if null and
exiting the function.

Coverity issue: 126584
Fixes: c0f87eb5252b ("cryptodev: change burst API to be crypto op oriented")

Signed-off-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
---
v2: Corrected PMD name in commit message

 drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c
index 9c42f88..31784e1 100644
--- a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c
+++ b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c
@@ -379,9 +379,11 @@ process_crypto_op(struct aesni_mb_qp *qp, struct rte_crypto_op *op,
 		/* append space for output data to mbuf */
 		char *odata = rte_pktmbuf_append(m_dst,
 				rte_pktmbuf_data_len(op->sym->m_src));
-		if (odata == NULL)
+		if (odata == NULL) {
 			MB_LOG_ERR("failed to allocate space in destination "
 					"mbuf for source data");
+			return NULL;
+		}
 
 		memcpy(odata, rte_pktmbuf_mtod(op->sym->m_src, void*),
 				rte_pktmbuf_data_len(op->sym->m_src));
-- 
2.5.5

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

* Re: [dpdk-dev] [PATCH v2] aesni_mb: fix null pointer dereferencing
  2016-06-07  9:36 ` [dpdk-dev] [PATCH v2] aesni_mb: " Jain, Deepak K
@ 2016-06-07 11:04   ` De Lara Guarch, Pablo
  2016-06-07 14:34     ` Thomas Monjalon
  0 siblings, 1 reply; 5+ messages in thread
From: De Lara Guarch, Pablo @ 2016-06-07 11:04 UTC (permalink / raw)
  To: Jain, Deepak K, dev; +Cc: Doherty, Declan, Jain, Deepak K



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Jain, Deepak K
> Sent: Tuesday, June 07, 2016 10:36 AM
> To: dev@dpdk.org
> Cc: Doherty, Declan; Jain, Deepak K
> Subject: [dpdk-dev] [PATCH v2] aesni_mb: fix null pointer dereferencing
> 
> Fix null pointer dereferencing by reporing if null and
> exiting the function.
> 
> Coverity issue: 126584
> Fixes: c0f87eb5252b ("cryptodev: change burst API to be crypto op oriented")
> 
> Signed-off-by: Deepak Kumar Jain <deepak.k.jain@intel.com>

Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>

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

* Re: [dpdk-dev] [PATCH v2] aesni_mb: fix null pointer dereferencing
  2016-06-07 11:04   ` De Lara Guarch, Pablo
@ 2016-06-07 14:34     ` Thomas Monjalon
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Monjalon @ 2016-06-07 14:34 UTC (permalink / raw)
  To: Jain, Deepak K; +Cc: dev, De Lara Guarch, Pablo, Doherty, Declan

> > Fix null pointer dereferencing by reporing if null and
> > exiting the function.
> > 
> > Coverity issue: 126584
> > Fixes: c0f87eb5252b ("cryptodev: change burst API to be crypto op oriented")
> > 
> > Signed-off-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
> 
> Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>

Applied, thanks

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

end of thread, other threads:[~2016-06-07 14:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-23 15:46 [dpdk-dev] [PATCH] crypto: fix null pointer dereferencing Deepak Kumar Jain
2016-06-02 13:58 ` De Lara Guarch, Pablo
2016-06-07  9:36 ` [dpdk-dev] [PATCH v2] aesni_mb: " Jain, Deepak K
2016-06-07 11:04   ` De Lara Guarch, Pablo
2016-06-07 14:34     ` 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).