summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo de Lara <pablo.de.lara.guarch@intel.com>2017-07-13 04:35:12 +0100
committerYuanhan Liu <yliu@fridaylinux.org>2017-08-29 14:50:27 +0800
commit1dcaf6c00a3d61d0c283775b0a0112986aa859cd (patch)
tree04216beb5b2e1e1e8211a827ebd2c845e8c07738
parent65ee9955de3e3ad932825801d1dd3eedf12c0594 (diff)
downloaddpdk-stable-1dcaf6c00a3d61d0c283775b0a0112986aa859cd.zip
dpdk-stable-1dcaf6c00a3d61d0c283775b0a0112986aa859cd.tar.gz
dpdk-stable-1dcaf6c00a3d61d0c283775b0a0112986aa859cd.tar.xz
crypto/aesni_mb: fix possible crypto job leak
[ upstream commit 7c95d47c1ead28b7ffa0fc77e33d76b014c9511e ] When dequeueing operations from an AESNI-MB device, crypto jobs are dequeued from the internal scheduler in the Multi-buffer library. If the number of jobs available to retrieve are higher than the number of crypto operations that are required, then an extra job is retrieved (due to an incorrect conditional), but not used. This leads to a job leak and the operation associated to that job will not be ever dequeued. Fixes: 0f548b50a160 ("crypto/aesni_mb: process crypto op on dequeue") Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com> Acked-by: Declan Doherty <declan.doherty@intel.com>
-rw-r--r--drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c
index 43e4865..9d40a9f 100644
--- a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c
+++ b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c
@@ -565,7 +565,7 @@ handle_completed_jobs(struct aesni_mb_qp *qp, JOB_AES_HMAC *job,
struct rte_crypto_op *op = NULL;
unsigned processed_jobs = 0;
- while (job != NULL && processed_jobs < nb_ops) {
+ while (job != NULL) {
op = post_process_mb_job(qp, job);
if (op) {
@@ -575,6 +575,8 @@ handle_completed_jobs(struct aesni_mb_qp *qp, JOB_AES_HMAC *job,
qp->stats.dequeue_err_count++;
break;
}
+ if (processed_jobs == nb_ops)
+ break;
job = (*qp->op_fns->job.get_completed_job)(&qp->mb_mgr);
}