diff mbox series

crypto/aesni_mb: check if session is valid

Message ID 1587380729-242821-1-git-send-email-pablo.de.lara.guarch@intel.com (mailing list archive)
State Accepted, archived
Delegated to: akhil goyal
Headers show
Series crypto/aesni_mb: check if session is valid | expand

Checks

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

Commit Message

De Lara Guarch, Pablo April 20, 2020, 11:05 a.m. UTC
Check if session is valid after getting operation
out of the internal IPSec MB manager, in case the
session has been freed while the operation was still
inside the manager.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Akhil Goyal May 9, 2020, 9:38 p.m. UTC | #1
> 
> Check if session is valid after getting operation
> out of the internal IPSec MB manager, in case the
> session has been freed while the operation was still
> inside the manager.
> 
> Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
> ---

Applied to dpdk-next-crypto

Thanks.
diff mbox series

Patch

diff --git a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c
index a1d59e8..4bfc752 100644
--- a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c
+++ b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c
@@ -1178,6 +1178,10 @@  post_process_mb_job(struct aesni_mb_qp *qp, JOB_AES_HMAC *job)
 	struct aesni_mb_session *sess = get_sym_session_private_data(
 							op->sym->session,
 							cryptodev_driver_id);
+	if (unlikely(sess == NULL)) {
+		op->status = RTE_CRYPTO_OP_STATUS_INVALID_SESSION;
+		return op;
+	}
 
 	if (likely(op->status == RTE_CRYPTO_OP_STATUS_NOT_PROCESSED)) {
 		switch (job->status) {