linux/crypto
Herbert Xu c2798145e7 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-22 07:15:01 +02:00
..
asymmetric_keys PKCS#7: pkcs7_validate_trust(): initialize the _trusted output argument 2016-07-12 08:47:23 -04:00
async_tx dmaengine: fix xor sources continuation 2014-08-21 10:20:52 -07:00
842.c crypto: prefix module autoloading with "crypto-" 2015-01-29 17:40:46 -08:00
ablk_helper.c crypto: ablk_helper - Replace memcpy with struct assignment 2013-10-07 14:16:57 +08:00
ablkcipher.c crypto: api - Only abort operations on fatal signal 2015-11-15 12:51:52 -05:00
aead.c crypto: user - fix info leaks in report API 2013-02-19 20:27:03 +08:00
aes_generic.c crypto: add missing crypto module aliases 2015-01-29 17:40:46 -08:00
af_alg.c crypto: af_alg - Forbid bind(2) when nokey child sockets are present 2016-02-09 22:57:33 -05:00
ahash.c crypto: ahash - Fix EINPROGRESS notification callback 2017-04-22 07:15:01 +02:00
algapi.c crypto: api - Only abort operations on fatal signal 2015-11-15 12:51:52 -05:00
algboss.c crypto: algboss - Hold ref count on larval 2013-06-25 19:15:17 +08:00
algif_hash.c crypto: algif_hash - avoid zero-sized array 2017-04-18 07:55:52 +02:00
algif_skcipher.c crypto: algif_skcipher - Fix race condition in skcipher_check_key 2016-04-19 07:57:03 -04:00
ansi_cprng.c crypto: add missing crypto module aliases 2015-01-29 17:40:46 -08:00
anubis.c crypto: prefix module autoloading with "crypto-" 2015-01-29 17:40:46 -08:00
api.c crypto: api - Only abort operations on fatal signal 2015-11-15 12:51:52 -05:00
arc4.c crypto: prefix module autoloading with "crypto-" 2015-01-29 17:40:46 -08:00
authenc.c crypto: include crypto- module prefix in template 2015-01-29 17:40:46 -08:00
authencesn.c crypto: include crypto- module prefix in template 2015-01-29 17:40:46 -08:00
blkcipher.c crypto: skcipher - Fix blkcipher walk OOM crash 2016-10-05 22:40:20 -04:00
blowfish_common.c crypto: blowfish - split generic and common c code 2011-09-22 21:25:25 +10:00
blowfish_generic.c crypto: add missing crypto module aliases 2015-01-29 17:40:46 -08:00
camellia_generic.c crypto: add missing crypto module aliases 2015-01-29 17:40:46 -08:00
cast5_generic.c crypto: add missing crypto module aliases 2015-01-29 17:40:46 -08:00
cast6_generic.c crypto: add missing crypto module aliases 2015-01-29 17:40:46 -08:00
cast_common.c crypto: make tables used from assembler __visible 2013-08-14 20:42:03 +10:00
cbc.c crypto: include crypto- module prefix in template 2015-01-29 17:40:46 -08:00
ccm.c crypto: include crypto- module prefix in template 2015-01-29 17:40:46 -08:00
chainiv.c crypto: include crypto- module prefix in template 2015-01-29 17:40:46 -08:00
cipher.c crypto: cipher - Fix checkpatch errors 2010-02-16 20:31:37 +08:00
cmac.c crypto: include crypto- module prefix in template 2015-01-29 17:40:46 -08:00
compress.c crypto: compress - Fix checkpatch errors 2010-02-16 20:31:04 +08:00
crc32.c crypto: prefix module autoloading with "crypto-" 2015-01-29 17:40:46 -08:00
crc32c_generic.c crypto: crc32c - Fix crc32c soft dependency 2016-02-09 22:57:34 -05:00
crct10dif_common.c crypto: crct10dif - Add fallback for broken initrds 2013-09-12 15:31:34 +10:00
crct10dif_generic.c crypto: add missing crypto module aliases 2015-01-29 17:40:46 -08:00
cryptd.c crypto: cryptd - Assign statesize properly 2017-04-18 07:55:52 +02:00
crypto_null.c crypto: prefix module autoloading with "crypto-" 2015-01-29 17:40:46 -08:00
crypto_user.c crypto: user - lock crypto_alg_list on alg dump 2016-03-02 15:18:58 -05:00
crypto_wq.c crypto: crypto_wq - Fix late crypto work queue initialization 2014-03-21 21:54:28 +08:00
ctr.c crypto: include crypto- module prefix in template 2015-01-29 17:40:46 -08:00
cts.c crypto: include crypto- module prefix in template 2015-01-29 17:40:46 -08:00
deflate.c crypto: prefix module autoloading with "crypto-" 2015-01-29 17:40:46 -08:00
des_generic.c crypto: add missing crypto module aliases 2015-01-29 17:40:46 -08:00
drbg.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2014-09-05 16:11:43 +08:00
ecb.c crypto: include crypto- module prefix in template 2015-01-29 17:40:46 -08:00
eseqiv.c crypto: include crypto- module prefix in template 2015-01-29 17:40:46 -08:00
fcrypt.c crypto: prefix module autoloading with "crypto-" 2015-01-29 17:40:46 -08:00
fips.c crypto: api - Add fips_enable flag 2008-08-29 15:50:02 +10:00
gcm.c crypto: gcm - Filter out async ghash if necessary 2016-08-22 12:23:00 -04:00
gf128mul.c crypto: gf128mul - fix call to memset() 2011-07-08 17:21:21 +08:00
ghash-generic.c crypto: add missing crypto module aliases 2015-01-29 17:40:46 -08:00
hash_info.c crypto: provide single place for hash algo information 2013-10-25 17:14:03 -04:00
hmac.c crypto: include crypto- module prefix in template 2015-01-29 17:40:46 -08:00
internal.h crypto: algboss - Hold ref count on larval 2013-06-25 19:15:17 +08:00
Kconfig Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2014-10-08 06:44:48 -04:00
khazad.c crypto: prefix module autoloading with "crypto-" 2015-01-29 17:40:46 -08:00
krng.c crypto: add missing crypto module aliases 2015-01-29 17:40:46 -08:00
lrw.c crypto: include crypto- module prefix in template 2015-01-29 17:40:46 -08:00
lz4.c crypto: prefix module autoloading with "crypto-" 2015-01-29 17:40:46 -08:00
lz4hc.c crypto: prefix module autoloading with "crypto-" 2015-01-29 17:40:46 -08:00
lzo.c crypto: prefix module autoloading with "crypto-" 2015-01-29 17:40:46 -08:00
Makefile crypto: improve gcc optimization flags for serpent and wp512 2017-04-18 07:55:50 +02:00
mcryptd.c crypto: mcryptd - Fix load failure 2017-04-18 07:55:52 +02:00
md4.c crypto: prefix module autoloading with "crypto-" 2015-01-29 17:40:46 -08:00
md5.c crypto: prefix module autoloading with "crypto-" 2015-01-29 17:40:46 -08:00
memneq.c crypto: memneq - fix for archs without efficient unaligned access 2013-12-09 20:09:12 +08:00
michael_mic.c crypto: prefix module autoloading with "crypto-" 2015-01-29 17:40:46 -08:00
pcbc.c crypto: include crypto- module prefix in template 2015-01-29 17:40:46 -08:00
pcompress.c crypto: user - fix info leaks in report API 2013-02-19 20:27:03 +08:00
pcrypt.c crypto: include crypto- module prefix in template 2015-01-29 17:40:46 -08:00
proc.c crypto: add module.h to those files that are explicitly using it 2011-10-31 19:31:11 -04:00
ripemd.h [CRYPTO] ripemd: Put all common RIPEMD values in header file 2008-07-10 20:35:12 +08:00
rmd128.c crypto: prefix module autoloading with "crypto-" 2015-01-29 17:40:46 -08:00
rmd160.c crypto: prefix module autoloading with "crypto-" 2015-01-29 17:40:46 -08:00
rmd256.c crypto: prefix module autoloading with "crypto-" 2015-01-29 17:40:46 -08:00
rmd320.c crypto: prefix module autoloading with "crypto-" 2015-01-29 17:40:46 -08:00
rng.c crypto: user - fix info leaks in report API 2013-02-19 20:27:03 +08:00
salsa20_generic.c crypto: add missing crypto module aliases 2015-01-29 17:40:46 -08:00
scatterwalk.c crypto: scatterwalk - Fix test in scatterwalk_done 2016-08-22 12:23:12 -04:00
seed.c crypto: prefix module autoloading with "crypto-" 2015-01-29 17:40:46 -08:00
seqiv.c crypto: include crypto- module prefix in template 2015-01-29 17:40:46 -08:00
serpent_generic.c crypto: add missing crypto module aliases 2015-01-29 17:40:46 -08:00
sha1_generic.c crypto: add missing crypto module aliases 2015-01-29 17:40:46 -08:00
sha256_generic.c crypto: add missing crypto module aliases 2015-01-29 17:40:46 -08:00
sha512_generic.c crypto: add missing crypto module aliases 2015-01-29 17:40:46 -08:00
shash.c crypto: shash - Fix has_key setting 2016-02-15 15:42:35 -05:00
tcrypt.c crypto: Resolve shadow warnings 2014-08-01 22:35:55 +08:00
tcrypt.h crypto: tcrypt - Added speed tests for AEAD crypto alogrithms in tcrypt test suite 2013-12-20 20:06:25 +08:00
tea.c crypto: add missing crypto module aliases 2015-01-29 17:40:46 -08:00
testmgr.c crypto: LLVMLinux: Remove VLAIS usage from crypto/testmgr.c 2014-10-14 10:51:24 +02:00
testmgr.h crypto: testmgr - add test for lz4 and lz4hc 2014-08-29 21:46:36 +08:00
tgr192.c crypto: add missing crypto module aliases 2015-01-29 17:40:46 -08:00
twofish_common.c crypto: twofish-x86_64-3way - add lrw support 2011-11-09 11:53:32 +08:00
twofish_generic.c crypto: add missing crypto module aliases 2015-01-29 17:40:46 -08:00
vmac.c crypto: include crypto- module prefix in template 2015-01-29 17:40:46 -08:00
wp512.c crypto: add missing crypto module aliases 2015-01-29 17:40:46 -08:00
xcbc.c crypto: include crypto- module prefix in template 2015-01-29 17:40:46 -08:00
xor.c add further __init annotations to crypto/xor.c 2012-10-11 13:42:32 +11:00
xts.c crypto: include crypto- module prefix in template 2015-01-29 17:40:46 -08:00
zlib.c crypto: prefix module autoloading with "crypto-" 2015-01-29 17:40:46 -08:00