From: <alok.makhariya@nxp.com>
To: <dev@dpdk.org>
Cc: <akhil.goyal@nxp.com>, <pablo.de.lara.guarch@intel.com>,
<hemant.agrawal@nxp.com>, Alok Makhariya <alok.makhariya@nxp.com>,
<stable@dpdk.org>
Subject: [dpdk-stable] [PATCH v2] crypto/dpaa2_sec: add check for segmented buffer
Date: Fri, 13 Oct 2017 21:08:54 +0530 [thread overview]
Message-ID: <20171013153854.8444-1-alok.makhariya@nxp.com> (raw)
In-Reply-To: <20171012130726.4332-2-alok.makhariya@nxp.com>
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
next prev parent reply other threads:[~2017-10-13 15:41 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20171012130726.4332-1-alok.makhariya@nxp.com>
2017-10-12 13:07 ` [dpdk-stable] [PATCH] " alok.makhariya
2017-10-13 15:38 ` alok.makhariya [this message]
2017-10-13 15:44 ` [dpdk-stable] [PATCH v2] " 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
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=20171013153854.8444-1-alok.makhariya@nxp.com \
--to=alok.makhariya@nxp.com \
--cc=akhil.goyal@nxp.com \
--cc=dev@dpdk.org \
--cc=hemant.agrawal@nxp.com \
--cc=pablo.de.lara.guarch@intel.com \
--cc=stable@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).