From cf6f70eea4cbe7ab79e4132cb25fb948cd379318 Mon Sep 17 00:00:00 2001 From: Alok Makhariya Date: Fri, 13 Oct 2017 21:07:30 +0530 Subject: [PATCH] crypto/dpaa_sec: add check for segmented buffer The code would crash in case of segmented buffer if no check Fixes: c3e85bdcc6e6 ("crypto/dpaa_sec: add crypto driver for NXP DPAA platform") Signed-off-by: Alok Makhariya Acked-by: Akhil Goyal --- drivers/crypto/dpaa_sec/dpaa_sec.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c index b54803c845..53f004eae6 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.c +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c @@ -890,6 +890,13 @@ dpaa_sec_enqueue_op(struct rte_crypto_op *op, struct dpaa_sec_qp *qp) return ret; } + /* + * Segmented buffer is not supported. + */ + if (!rte_pktmbuf_is_contiguous(op->sym->m_src)) { + op->status = RTE_CRYPTO_OP_STATUS_ERROR; + return -ENOTSUP; + } if (is_auth_only(ses)) { cf = build_auth_only(op, ses); } else if (is_cipher_only(ses)) { -- 2.20.1