From 04907345dbdae82de7b68e8a4b222d9e3df44def Mon Sep 17 00:00:00 2001 From: Ankur Dwivedi Date: Fri, 3 Jul 2020 11:11:40 +0530 Subject: [PATCH] crypto/octeontx2: reset session private data This patch sets the first 32 bytes of session private data to zero. This prevents garbage data to be used in code logic. Signed-off-by: Ankur Dwivedi --- drivers/crypto/octeontx2/otx2_cryptodev_ops.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/crypto/octeontx2/otx2_cryptodev_ops.c b/drivers/crypto/octeontx2/otx2_cryptodev_ops.c index ad292a08f7..c0aed612a9 100644 --- a/drivers/crypto/octeontx2/otx2_cryptodev_ops.c +++ b/drivers/crypto/octeontx2/otx2_cryptodev_ops.c @@ -364,6 +364,9 @@ sym_session_configure(int driver_id, struct rte_crypto_sym_xform *xform, return -ENOMEM; } + memset(priv, 0, sizeof(struct cpt_sess_misc) + + offsetof(struct cpt_ctx, fctx)); + misc = priv; for ( ; xform != NULL; xform = xform->next) { -- 2.20.1