From: Alok Makhariya Date: Fri, 13 Oct 2017 15:38:54 +0000 (+0530) Subject: crypto/dpaa2_sec: add check for segmented buffer X-Git-Tag: spdx-start~1209 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=9b0b95a48c0e171454cfca4231cecac7d470a75c;p=dpdk.git crypto/dpaa2_sec: add check for segmented buffer 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 Acked-by: Akhil Goyal --- diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c index 17365ac5de..0a466ba7f4 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c @@ -548,7 +548,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);