Skip to content

Commit

Permalink
crypto/mvsam: fix session data reset
Browse files Browse the repository at this point in the history
[ upstream commit 03e73e8 ]

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: 8a61c83 ("crypto/mrvl: add mrvl crypto driver")

Signed-off-by: Dana Vardi <danat@marvell.com>
Reviewed-by: Michael Shamis <michaelsh@marvell.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
  • Loading branch information
Dana Vardi authored and bluca committed Jul 12, 2021
1 parent 79eb8ff commit 9bf79cb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/crypto/mvsam/rte_mrvl_pmd_ops.c
Expand Up @@ -793,7 +793,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);
Expand Down

0 comments on commit 9bf79cb

Please sign in to comment.