linux/include/crypto/internal
Herbert Xu c104795918 crypto: ahash - Fix EINPROGRESS notification callback
commit ef0579b64e upstream.

The ahash API modifies the request's callback function in order
to clean up after itself in some corner cases (unaligned final
and missing finup).

When the request is complete ahash will restore the original
callback and everything is fine.  However, when the request gets
an EBUSY on a full queue, an EINPROGRESS callback is made while
the request is still ongoing.

In this case the ahash API will incorrectly call its own callback.

This patch fixes the problem by creating a temporary request
object on the stack which is used to relay EINPROGRESS back to
the original completion function.

This patch also adds code to preserve the original flags value.

Fixes: ab6bf4e5e5 ("crypto: hash - Fix the pointer voodoo in...")
Reported-by: Sabrina Dubroca <sd@queasysnail.net>
Tested-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2017-04-21 09:31:23 +02:00
..
aead.h crypto: aead - Add chunk size 2016-07-18 17:35:38 +08:00
akcipher.h crypto: akcipher - add akcipher declarations needed by templates. 2015-12-09 20:03:57 +08:00
geniv.h crypto: aead - Remove blkcipher null for IV generators 2016-07-18 17:35:43 +08:00
hash.h crypto: ahash - Fix EINPROGRESS notification callback 2017-04-21 09:31:23 +02:00
kpp.h crypto: kpp - Key-agreement Protocol Primitives API (KPP) 2016-06-23 18:29:56 +08:00
rng.h crypto: rng - Do not free default RNG when it becomes unused 2015-06-22 15:49:18 +08:00
rsa.h crypto: rsa - Store rest of the private key components 2016-07-05 23:05:26 +08:00
skcipher.h crypto: skcipher - Remove top-level givcipher interface 2016-07-18 17:35:46 +08:00