OSDN Git Service

staging: ccree: do not map bufs in ahash_init
authorGilad Ben-Yossef <gilad@benyossef.com>
Sun, 7 Jan 2018 12:14:30 +0000 (12:14 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 8 Jan 2018 15:27:23 +0000 (16:27 +0100)
commit2c8cdb6b5d7b23fb6085f3581c76c1d5fc321343
treef9ab1b1caaa6088541cb455bd09d8d0c4ea0911d
parent9b3044b88ebe580883ac20cb5bcf8a3f3e4006f8
staging: ccree: do not map bufs in ahash_init

hash_init was mapping DMA memory that were then being unmap in
hash_digest/final/finup callbacks, which is against the Crypto API
usage rules (see discussion at
https://www.mail-archive.com/linux-crypto@vger.kernel.org/msg30077.html)

Fix it by moving all buffer mapping/unmapping or each Crypto API op.

This also properly deals with hash_import() not knowing if
hash_init was called or not as it now no longer matters.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/ccree/ssi_hash.c