From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 907C5A04AB; Mon, 31 Aug 2020 10:52:35 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7B1BE1C0B6; Mon, 31 Aug 2020 10:52:34 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by dpdk.org (Postfix) with ESMTP id BEC191C0B1; Mon, 31 Aug 2020 10:52:32 +0200 (CEST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4CB141FB; Mon, 31 Aug 2020 01:52:32 -0700 (PDT) Received: from net-arm-thunderx2-02.shanghai.arm.com (net-arm-thunderx2-02.shanghai.arm.com [10.169.210.116]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id E15753F68F; Mon, 31 Aug 2020 01:52:28 -0700 (PDT) From: Ruifeng Wang To: Ruifeng Wang , Akhil Goyal , Slawomir Mrozowicz , Pablo de Lara , Declan Doherty , Fiona Trahe , Fan Zhang Cc: dev@dpdk.org, honnappa.nagarahalli@arm.com, nd@arm.com, stable@dpdk.org Date: Mon, 31 Aug 2020 16:51:44 +0800 Message-Id: <20200831085145.184179-3-ruifeng.wang@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200831085145.184179-1-ruifeng.wang@arm.com> References: <20200831085145.184179-1-ruifeng.wang@arm.com> Subject: [dpdk-dev] [PATCH 2/3] crypto/armv8: fix mempool object returning X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- drivers/crypto/armv8/rte_armv8_pmd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/armv8/rte_armv8_pmd.c b/drivers/crypto/armv8/rte_armv8_pmd.c index c95729db5..72d29ae0c 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; } -- 2.17.1