android_kernel_oneplus_msm8998/include/crypto/internal
Herbert Xu 2673d1c512 crypto: ahash - Fix EINPROGRESS notification callback
commit ef0579b64e93188710d48667cb5e014926af9f1b 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>
2017-04-21 09:30:06 +02:00
..
aead.h crypto: aead - Remove old AEAD interfaces 2015-08-17 16:53:50 +08:00
akcipher.h crypto: akcipher - add PKE API 2015-06-17 17:03:14 +08:00
compress.h crypto: compress - Add pcomp interface 2009-03-04 15:05:33 +08:00
geniv.h crypto: aead - Remove old AEAD interfaces 2015-08-17 16:53:50 +08:00
hash.h crypto: ahash - Fix EINPROGRESS notification callback 2017-04-21 09:30:06 +02: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: akcipher - Changes to asymmetric key API 2015-10-14 22:23:16 +08:00
skcipher.h crypto: skcipher - Add top-level skcipher interface 2015-08-21 22:21:19 +08:00