]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: marvell - Update transformation context for each dequeued req
authorRomain Perier <romain.perier@free-electrons.com>
Tue, 9 Aug 2016 09:03:18 +0000 (11:03 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Tue, 9 Aug 2016 10:47:30 +0000 (18:47 +0800)
commit346fdc4509fa7262dd1f8aa42c68239fc67c7df7
treef4bf4878b61816f65dacfe65d4bd84849a829a80
parent2bc58e892193b8136a50d6789e4d3d5db345469b
crypto: marvell - Update transformation context for each dequeued req

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 4bac03b18267 ("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>
drivers/crypto/marvell/cesa.c