From: Ruifeng Wang Date: Mon, 31 Aug 2020 08:51:44 +0000 (+0800) Subject: crypto/armv8: fix mempool object returning X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=76a4ed5b3bc91c5296e3d6780243d237f3ed8506;p=dpdk.git crypto/armv8: fix mempool object returning Crypto session and device session private data were put back to wrong pools. This caused data corruption when the object was reallocated and used. Because objects from different mempools have different element size, and wrong mempool info caused out of bound write. Fix the issue by putting back objects to correct mempools. Fixes: b3bbd9e5f265 ("cryptodev: support device independent sessions") Fixes: 725d2a7fbf71 ("cryptodev: change queue pair configure structure") Cc: stable@dpdk.org Signed-off-by: Ruifeng Wang Acked-by: Akhil Goyal --- diff --git a/drivers/crypto/armv8/rte_armv8_pmd.c b/drivers/crypto/armv8/rte_armv8_pmd.c index c95729db50..72d29ae0cb 100644 --- a/drivers/crypto/armv8/rte_armv8_pmd.c +++ b/drivers/crypto/armv8/rte_armv8_pmd.c @@ -674,8 +674,8 @@ process_op(struct armv8_crypto_qp *qp, struct rte_crypto_op *op, memset(op->sym->session, 0, rte_cryptodev_sym_get_existing_header_session_size( op->sym->session)); - rte_mempool_put(qp->sess_mp, sess); - rte_mempool_put(qp->sess_mp_priv, op->sym->session); + rte_mempool_put(qp->sess_mp_priv, sess); + rte_mempool_put(qp->sess_mp, op->sym->session); op->sym->session = NULL; }