diff mbox series

crypto/mvsam: fix memset of mrvl sess private data

Message ID 20210701065920.31096-1-danat@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: akhil goyal
Headers show
Series crypto/mvsam: fix memset of mrvl sess private data | expand

Checks

Context Check Description
ci/iol-abi-testing success Testing PASS
ci/iol-intel-Performance fail Performance Testing issues
ci/iol-mellanox-Functional fail Functional Testing issues
ci/iol-testing fail Testing issues
ci/intel-Testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-intel-Functional success Functional Testing PASS
ci/github-robot success github build: passed
ci/checkpatch success coding style OK

Commit Message

danat@marvell.com July 1, 2021, 6:59 a.m. UTC
From: Dana Vardi <danat@marvell.com>

This patch fix wrong clear memory session pointer.

When call mrvl_crypto_pmd_sym_session_clear function,
it might cause the following error:
CRYPTODEV: set_sym_session_private_data() line 497:
Set private data for driver 1 not allowed

This fix set zeroes to mrvl_crypto_session pointer instead to
rte_cryptodev_sym_session pointer, and will verify that
rte_cryptodev_sym_session pointer will not lose data such as
nb_drivers.

Bugzilla ID: 646
Fixes: 8a61c83af2fa ("crypto/mrvl: add mrvl crypto driver")
Cc: stable@dpdk.org

Signed-off-by: Dana Vardi <danat@marvell.com>
Reviewed-by: Michael Shamis <michaelsh@marvell.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
---
 drivers/crypto/mvsam/rte_mrvl_pmd_ops.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Akhil Goyal July 7, 2021, 3:41 p.m. UTC | #1
> From: Dana Vardi <danat@marvell.com>
> 
> This patch fix wrong clear memory session pointer.
> 
> When call mrvl_crypto_pmd_sym_session_clear function,
> it might cause the following error:
> CRYPTODEV: set_sym_session_private_data() line 497:
> Set private data for driver 1 not allowed
> 
> This fix set zeroes to mrvl_crypto_session pointer instead to
> rte_cryptodev_sym_session pointer, and will verify that
> rte_cryptodev_sym_session pointer will not lose data such as
> nb_drivers.
> 
> Bugzilla ID: 646
> Fixes: 8a61c83af2fa ("crypto/mrvl: add mrvl crypto driver")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Dana Vardi <danat@marvell.com>
> Reviewed-by: Michael Shamis <michaelsh@marvell.com>
> Reviewed-by: Liron Himi <lironh@marvell.com>
> ---
Applied to dpdk-next-crypto

Thanks.
diff mbox series

Patch

diff --git a/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c b/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c
index 3cb7e3b9c..1a0a9fc14 100644
--- a/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c
+++ b/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c
@@ -794,7 +794,7 @@  mrvl_crypto_pmd_sym_session_clear(struct rte_cryptodev *dev,
 			MRVL_LOG(ERR, "Error while destroying session!");
 		}
 
-		memset(sess, 0, sizeof(struct mrvl_crypto_session));
+		memset(mrvl_sess, 0, sizeof(struct mrvl_crypto_session));
 		struct rte_mempool *sess_mp = rte_mempool_from_obj(sess_priv);
 		set_sym_session_private_data(sess, index, NULL);
 		rte_mempool_put(sess_mp, sess_priv);