summaryrefslogtreecommitdiff
path: root/drivers/crypto
diff options
context:
space:
mode:
authorRomain Perier <romain.perier@free-electrons.com>2016-08-09 11:03:18 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-10-31 05:02:09 -0600
commiteaf23c11fffbcc4f886c1a8346a17d65f8db3525 (patch)
treeed544a99233362d5eec720e6d22a1b144dab9c8b /drivers/crypto
parent9c1ea6c6313b6b7bb20e3b184f9a7c99209e6220 (diff)
downloadlwn-eaf23c11fffbcc4f886c1a8346a17d65f8db3525.tar.gz
lwn-eaf23c11fffbcc4f886c1a8346a17d65f8db3525.zip
crypto: marvell - Update transformation context for each dequeued req
commit 09951d83fc58a6f772de09c08e370f6d9970dbb6 upstream. So far, sub part of mv_cesa_int was responsible of dequeuing complete requests, then call the 'cleanup' operation on these reqs and call the crypto api callback 'complete'. The problem is that the transformation context 'ctx' is retrieved only once before the while loop. Which means that the wrong 'cleanup' operation might be called on the wrong type of cesa requests, it can lead to memory corruptions with this message: marvell-cesa f1090000.crypto: dma_pool_free cesa_padding, 5a5a5a5a/5a5a5a5a (bad dma) This commit fixes the issue, by updating the transformation context for each dequeued cesa request. Fixes: commit 85030c5168f1 ("crypto: marvell - Add support for chai...") Signed-off-by: Romain Perier <romain.perier@free-electrons.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/crypto')
-rw-r--r--drivers/crypto/marvell/cesa.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/crypto/marvell/cesa.c b/drivers/crypto/marvell/cesa.c
index d64af8625d7e..37dadb2a4feb 100644
--- a/drivers/crypto/marvell/cesa.c
+++ b/drivers/crypto/marvell/cesa.c
@@ -166,6 +166,7 @@ static irqreturn_t mv_cesa_int(int irq, void *priv)
if (!req)
break;
+ ctx = crypto_tfm_ctx(req->tfm);
mv_cesa_complete_req(ctx, req, 0);
}
}