DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ruifeng Wang <ruifeng.wang@arm.com>
To: Ruifeng Wang <ruifeng.wang@arm.com>,
	Akhil Goyal <akhil.goyal@nxp.com>,
	Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>,
	Pablo de Lara <pablo.de.lara.guarch@intel.com>,
	Declan Doherty <declan.doherty@intel.com>,
	Fiona Trahe <fiona.trahe@intel.com>,
	Fan Zhang <roy.fan.zhang@intel.com>
Cc: dev@dpdk.org, honnappa.nagarahalli@arm.com, nd@arm.com, stable@dpdk.org
Subject: [dpdk-dev] [PATCH 2/3] crypto/armv8: fix mempool object returning
Date: Mon, 31 Aug 2020 16:51:44 +0800	[thread overview]
Message-ID: <20200831085145.184179-3-ruifeng.wang@arm.com> (raw)
In-Reply-To: <20200831085145.184179-1-ruifeng.wang@arm.com>

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 <ruifeng.wang@arm.com>
---
 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


  parent reply	other threads:[~2020-08-31  8:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-31  8:51 [dpdk-dev] [PATCH 0/3] armv8 crypto PMD Ruifeng Wang
2020-08-31  8:51 ` [dpdk-dev] [PATCH 1/3] test/crypto: fix stat test Ruifeng Wang
2020-09-01  9:46   ` Dybkowski, AdamX
2020-08-31  8:51 ` Ruifeng Wang [this message]
2020-08-31  8:51 ` [dpdk-dev] [PATCH 3/3] crypto/armv8: move to cryptodev test suite Ruifeng Wang
2020-10-08 21:05 ` [dpdk-dev] [PATCH 0/3] armv8 crypto PMD Akhil Goyal

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=20200831085145.184179-3-ruifeng.wang@arm.com \
    --to=ruifeng.wang@arm.com \
    --cc=akhil.goyal@nxp.com \
    --cc=declan.doherty@intel.com \
    --cc=dev@dpdk.org \
    --cc=fiona.trahe@intel.com \
    --cc=honnappa.nagarahalli@arm.com \
    --cc=nd@arm.com \
    --cc=pablo.de.lara.guarch@intel.com \
    --cc=roy.fan.zhang@intel.com \
    --cc=slawomirx.mrozowicz@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).