]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: ccree - unmap buffer before copying IV
authorGilad Ben-Yossef <gilad@benyossef.com>
Tue, 15 Jan 2019 13:43:15 +0000 (15:43 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 25 Jan 2019 10:41:51 +0000 (18:41 +0800)
commit90b1c08a73aae53043a68434de5030eb2a9d8647
treea8b90241f54ba1cd844a34f8ae3d4d022216998e
parentba19b446f4d743098d3d318581cc40ea743ba182
crypto: ccree - unmap buffer before copying IV

We were copying the last ciphertext block into the IV field
for CBC before removing the DMA mapping of the output buffer
with the result of the buffer sometime being out-of-sync cache
wise and were getting intermittent cases of bad output IV.

Fix it by moving the DMA buffer unmapping before the copy.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Fixes: 2b75e7048d11 ("crypto: ccree - fix iv handling")
Cc: <stable@vger.kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/ccree/cc_cipher.c