From: Pablo de Lara Date: Mon, 20 Apr 2020 11:05:29 +0000 (+0100) Subject: crypto/aesni_mb: check if session is valid X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=20731cd8cb0799aff1cc2230d345c9e1f3420475;p=dpdk.git crypto/aesni_mb: check if session is valid 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 --- diff --git a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c index a1d59e89b7..4bfc752dca 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) {