* [dpdk-stable] [PATCH] crypto/dpaa2_sec: add check for segmented buffer [not found] <20171012130726.4332-1-alok.makhariya@nxp.com> @ 2017-10-12 13:07 ` alok.makhariya 2017-10-13 15:38 ` [dpdk-stable] [PATCH v2] " alok.makhariya 2017-10-12 13:07 ` [dpdk-stable] [PATCH] crypto/dpaa2_sec: remove memset of icv on decryption side alok.makhariya 1 sibling, 1 reply; 7+ messages in thread From: alok.makhariya @ 2017-10-12 13:07 UTC (permalink / raw) To: dev Cc: akhil.goyal, pablo.de.lara.guarch, hemant.agrawal, Alok Makhariya, stable From: Alok Makhariya <alok.makhariya@nxp.com> The code would crash for segmented buffer if no check. Fixes: 8d1f3a5d751b ("crypto/dpaa2_sec: support crypto operation") Cc: stable@dpdk.org Signed-off-by: Alok Makhariya <alok.makhariya@nxp.com> --- drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c index 672cacf..9895300 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c @@ -551,7 +551,13 @@ build_sec_fd(dpaa2_sec_session *sess, struct rte_crypto_op *op, int ret = -1; PMD_INIT_FUNC_TRACE(); - + /* + * Segmented buffer is not supported. + */ + if (!rte_pktmbuf_is_contiguous(op->sym->m_src)) { + op->status = RTE_CRYPTO_OP_STATUS_ERROR; + return -ENOTSUP; + } switch (sess->ctxt_type) { case DPAA2_SEC_CIPHER: ret = build_cipher_fd(sess, op, fd, bpid); -- 2.9.3 ^ permalink raw reply [flat|nested] 7+ messages in thread
* [dpdk-stable] [PATCH v2] crypto/dpaa2_sec: add check for segmented buffer 2017-10-12 13:07 ` [dpdk-stable] [PATCH] crypto/dpaa2_sec: add check for segmented buffer alok.makhariya @ 2017-10-13 15:38 ` alok.makhariya 2017-10-13 15:44 ` Akhil Goyal 0 siblings, 1 reply; 7+ messages in thread From: alok.makhariya @ 2017-10-13 15:38 UTC (permalink / raw) To: dev Cc: akhil.goyal, pablo.de.lara.guarch, hemant.agrawal, Alok Makhariya, stable From: Alok Makhariya <alok.makhariya@nxp.com> The code would crash for segmented buffer if no check. Fixes: 8d1f3a5d751b ("crypto/dpaa2_sec: support crypto operation") Cc: stable@dpdk.org Signed-off-by: Alok Makhariya <alok.makhariya@nxp.com> --- drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c index 672cacf..b33081c 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c @@ -551,7 +551,13 @@ build_sec_fd(dpaa2_sec_session *sess, struct rte_crypto_op *op, int ret = -1; PMD_INIT_FUNC_TRACE(); - + /* + * Segmented buffer is not supported. + */ + if (!rte_pktmbuf_is_contiguous(op->sym->m_src)) { + op->status = RTE_CRYPTO_OP_STATUS_ERROR; + return -ENOTSUP; + } switch (sess->ctxt_type) { case DPAA2_SEC_CIPHER: ret = build_cipher_fd(sess, op, fd, bpid); -- 2.9.3 ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dpdk-stable] [PATCH v2] crypto/dpaa2_sec: add check for segmented buffer 2017-10-13 15:38 ` [dpdk-stable] [PATCH v2] " alok.makhariya @ 2017-10-13 15:44 ` Akhil Goyal 2017-10-16 14:06 ` De Lara Guarch, Pablo 0 siblings, 1 reply; 7+ messages in thread From: Akhil Goyal @ 2017-10-13 15:44 UTC (permalink / raw) To: alok.makhariya, dev; +Cc: pablo.de.lara.guarch, hemant.agrawal, stable On 10/13/2017 9:08 PM, alok.makhariya@nxp.com wrote: > From: Alok Makhariya <alok.makhariya@nxp.com> > > The code would crash for segmented buffer if no check. > > Fixes: 8d1f3a5d751b ("crypto/dpaa2_sec: support crypto operation") > Cc: stable@dpdk.org > > Signed-off-by: Alok Makhariya <alok.makhariya@nxp.com> > --- > drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c > index 672cacf..b33081c 100644 > --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c > +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c > @@ -551,7 +551,13 @@ build_sec_fd(dpaa2_sec_session *sess, struct rte_crypto_op *op, > int ret = -1; > > PMD_INIT_FUNC_TRACE(); > - > + /* > + * Segmented buffer is not supported. > + */ > + if (!rte_pktmbuf_is_contiguous(op->sym->m_src)) { > + op->status = RTE_CRYPTO_OP_STATUS_ERROR; > + return -ENOTSUP; > + } > switch (sess->ctxt_type) { > case DPAA2_SEC_CIPHER: > ret = build_cipher_fd(sess, op, fd, bpid); > Acked-by: Akhil Goyal <akhil.goyal@nxp.com> ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dpdk-stable] [PATCH v2] crypto/dpaa2_sec: add check for segmented buffer 2017-10-13 15:44 ` Akhil Goyal @ 2017-10-16 14:06 ` De Lara Guarch, Pablo 0 siblings, 0 replies; 7+ messages in thread From: De Lara Guarch, Pablo @ 2017-10-16 14:06 UTC (permalink / raw) To: Akhil Goyal, alok.makhariya, dev; +Cc: hemant.agrawal, stable > -----Original Message----- > From: Akhil Goyal [mailto:akhil.goyal@nxp.com] > Sent: Friday, October 13, 2017 4:45 PM > To: alok.makhariya@nxp.com; dev@dpdk.org > Cc: De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>; > hemant.agrawal@nxp.com; stable@dpdk.org > Subject: Re: [PATCH v2] crypto/dpaa2_sec: add check for segmented buffer > > On 10/13/2017 9:08 PM, alok.makhariya@nxp.com wrote: > > From: Alok Makhariya <alok.makhariya@nxp.com> > > > > The code would crash for segmented buffer if no check. > > > > Fixes: 8d1f3a5d751b ("crypto/dpaa2_sec: support crypto operation") > > Cc: stable@dpdk.org > > > > Signed-off-by: Alok Makhariya <alok.makhariya@nxp.com> > > --- > > drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 8 +++++++- > > 1 file changed, 7 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c > b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c > > index 672cacf..b33081c 100644 > > --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c > > +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c > > @@ -551,7 +551,13 @@ build_sec_fd(dpaa2_sec_session *sess, struct > rte_crypto_op *op, > > int ret = -1; > > > > PMD_INIT_FUNC_TRACE(); > > - > > + /* > > + * Segmented buffer is not supported. > > + */ > > + if (!rte_pktmbuf_is_contiguous(op->sym->m_src)) { > > + op->status = RTE_CRYPTO_OP_STATUS_ERROR; > > + return -ENOTSUP; > > + } > > switch (sess->ctxt_type) { > > case DPAA2_SEC_CIPHER: > > ret = build_cipher_fd(sess, op, fd, bpid); > > > Acked-by: Akhil Goyal <akhil.goyal@nxp.com> Applied to dpdk-next-crypto. Thanks, Pablo ^ permalink raw reply [flat|nested] 7+ messages in thread
* [dpdk-stable] [PATCH] crypto/dpaa2_sec: remove memset of icv on decryption side [not found] <20171012130726.4332-1-alok.makhariya@nxp.com> 2017-10-12 13:07 ` [dpdk-stable] [PATCH] crypto/dpaa2_sec: add check for segmented buffer alok.makhariya @ 2017-10-12 13:07 ` alok.makhariya 2017-10-13 14:24 ` Akhil Goyal 1 sibling, 1 reply; 7+ messages in thread From: alok.makhariya @ 2017-10-12 13:07 UTC (permalink / raw) To: dev Cc: akhil.goyal, pablo.de.lara.guarch, hemant.agrawal, Alok Makhariya, stable From: Alok Makhariya <alok.makhariya@nxp.com> Since the packet lengths are modified. It is not required to explicitly reset the icv. Fixes: 13273250eec5 ("crypto/dpaa2_sec: support AES-GCM and CTR") Fixes: 8d1f3a5d751b ("crypto/dpaa2_sec: support crypto operation") Cc: stable@dpdk.org Signed-off-by: Alok Makhariya <alok.makhariya@nxp.com> --- drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c index 9895300..62b9203 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c @@ -203,7 +203,6 @@ build_authenc_gcm_fd(dpaa2_sec_session *sess, old_icv = (uint8_t *)(sge + 1); memcpy(old_icv, sym_op->aead.digest.data, sess->digest_length); - memset(sym_op->aead.digest.data, 0, sess->digest_length); DPAA2_SET_FLE_ADDR(sge, DPAA2_VADDR_TO_IOVA(old_icv)); sge->length = sess->digest_length; DPAA2_SET_FD_LEN(fd, (sym_op->aead.data.length + @@ -342,7 +341,6 @@ build_authenc_fd(dpaa2_sec_session *sess, old_icv = (uint8_t *)(sge + 1); memcpy(old_icv, sym_op->auth.digest.data, sess->digest_length); - memset(sym_op->auth.digest.data, 0, sess->digest_length); DPAA2_SET_FLE_ADDR(sge, DPAA2_VADDR_TO_IOVA(old_icv)); sge->length = sess->digest_length; DPAA2_SET_FD_LEN(fd, (sym_op->auth.data.length + @@ -436,7 +434,6 @@ build_auth_fd(dpaa2_sec_session *sess, struct rte_crypto_op *op, old_digest = (uint8_t *)(sge + 1); rte_memcpy(old_digest, sym_op->auth.digest.data, sess->digest_length); - memset(sym_op->auth.digest.data, 0, sess->digest_length); DPAA2_SET_FLE_ADDR(sge, DPAA2_VADDR_TO_IOVA(old_digest)); sge->length = sess->digest_length; fle->length = sym_op->auth.data.length + -- 2.9.3 ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dpdk-stable] [PATCH] crypto/dpaa2_sec: remove memset of icv on decryption side 2017-10-12 13:07 ` [dpdk-stable] [PATCH] crypto/dpaa2_sec: remove memset of icv on decryption side alok.makhariya @ 2017-10-13 14:24 ` Akhil Goyal 2017-10-16 11:21 ` De Lara Guarch, Pablo 0 siblings, 1 reply; 7+ messages in thread From: Akhil Goyal @ 2017-10-13 14:24 UTC (permalink / raw) To: alok.makhariya, dev; +Cc: pablo.de.lara.guarch, hemant.agrawal, stable On 10/12/2017 6:37 PM, alok.makhariya@nxp.com wrote: > From: Alok Makhariya <alok.makhariya@nxp.com> > > Since the packet lengths are modified. It is not required to > explicitly reset the icv. > > Fixes: 13273250eec5 ("crypto/dpaa2_sec: support AES-GCM and CTR") > Fixes: 8d1f3a5d751b ("crypto/dpaa2_sec: support crypto operation") > Cc: stable@dpdk.org > > Signed-off-by: Alok Makhariya <alok.makhariya@nxp.com> > --- > drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 3 --- > 1 file changed, 3 deletions(-) > > diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c > index 9895300..62b9203 100644 > --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c > +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c > @@ -203,7 +203,6 @@ build_authenc_gcm_fd(dpaa2_sec_session *sess, > old_icv = (uint8_t *)(sge + 1); > memcpy(old_icv, sym_op->aead.digest.data, > sess->digest_length); > - memset(sym_op->aead.digest.data, 0, sess->digest_length); > DPAA2_SET_FLE_ADDR(sge, DPAA2_VADDR_TO_IOVA(old_icv)); > sge->length = sess->digest_length; > DPAA2_SET_FD_LEN(fd, (sym_op->aead.data.length + > @@ -342,7 +341,6 @@ build_authenc_fd(dpaa2_sec_session *sess, > old_icv = (uint8_t *)(sge + 1); > memcpy(old_icv, sym_op->auth.digest.data, > sess->digest_length); > - memset(sym_op->auth.digest.data, 0, sess->digest_length); > DPAA2_SET_FLE_ADDR(sge, DPAA2_VADDR_TO_IOVA(old_icv)); > sge->length = sess->digest_length; > DPAA2_SET_FD_LEN(fd, (sym_op->auth.data.length + > @@ -436,7 +434,6 @@ build_auth_fd(dpaa2_sec_session *sess, struct rte_crypto_op *op, > old_digest = (uint8_t *)(sge + 1); > rte_memcpy(old_digest, sym_op->auth.digest.data, > sess->digest_length); > - memset(sym_op->auth.digest.data, 0, sess->digest_length); > DPAA2_SET_FLE_ADDR(sge, DPAA2_VADDR_TO_IOVA(old_digest)); > sge->length = sess->digest_length; > fle->length = sym_op->auth.data.length + > > Acked-by: Akhil Goyal <akhil.goyal@nxp.com> ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dpdk-stable] [PATCH] crypto/dpaa2_sec: remove memset of icv on decryption side 2017-10-13 14:24 ` Akhil Goyal @ 2017-10-16 11:21 ` De Lara Guarch, Pablo 0 siblings, 0 replies; 7+ messages in thread From: De Lara Guarch, Pablo @ 2017-10-16 11:21 UTC (permalink / raw) To: Akhil Goyal, alok.makhariya, dev; +Cc: hemant.agrawal, stable > -----Original Message----- > From: Akhil Goyal [mailto:akhil.goyal@nxp.com] > Sent: Friday, October 13, 2017 3:24 PM > To: alok.makhariya@nxp.com; dev@dpdk.org > Cc: De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>; > hemant.agrawal@nxp.com; stable@dpdk.org > Subject: Re: [PATCH] crypto/dpaa2_sec: remove memset of icv on > decryption side > > On 10/12/2017 6:37 PM, alok.makhariya@nxp.com wrote: > > From: Alok Makhariya <alok.makhariya@nxp.com> > > > > Since the packet lengths are modified. It is not required to > > explicitly reset the icv. > > > > Fixes: 13273250eec5 ("crypto/dpaa2_sec: support AES-GCM and CTR") > > Fixes: 8d1f3a5d751b ("crypto/dpaa2_sec: support crypto operation") > > Cc: stable@dpdk.org > > > > Signed-off-by: Alok Makhariya <alok.makhariya@nxp.com> ... > Acked-by: Akhil Goyal <akhil.goyal@nxp.com> Applied to dpdk-next-crypto. Thanks, Pablo ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2017-10-16 14:07 UTC | newest] Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <20171012130726.4332-1-alok.makhariya@nxp.com> 2017-10-12 13:07 ` [dpdk-stable] [PATCH] crypto/dpaa2_sec: add check for segmented buffer alok.makhariya 2017-10-13 15:38 ` [dpdk-stable] [PATCH v2] " alok.makhariya 2017-10-13 15:44 ` Akhil Goyal 2017-10-16 14:06 ` De Lara Guarch, Pablo 2017-10-12 13:07 ` [dpdk-stable] [PATCH] crypto/dpaa2_sec: remove memset of icv on decryption side alok.makhariya 2017-10-13 14:24 ` Akhil Goyal 2017-10-16 11:21 ` 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).