kernel_linux/include/crypto
Stephan Mueller 7d2c3f54e6 crypto: af_alg - remove locking in async callback
The code paths protected by the socket-lock do not use or modify the
socket in a non-atomic fashion. The actions pertaining the socket do not
even need to be handled as an atomic operation. Thus, the socket-lock
can be safely ignored.

This fixes a bug regarding scheduling in atomic as the callback function
may be invoked in interrupt context.

In addition, the sock_hold is moved before the AIO encrypt/decrypt
operation to ensure that the socket is always present. This avoids a
tiny race window where the socket is unprotected and yet used by the AIO
operation.

Finally, the release of resources for a crypto operation is moved into a
common function of af_alg_free_resources.

Cc: <stable@vger.kernel.org>
Fixes: e870456d8e ("crypto: algif_skcipher - overhaul memory management")
Fixes: d887c52d6a ("crypto: algif_aead - overhaul memory management")
Reported-by: Romain Izard <romain.izard.pro@gmail.com>
Signed-off-by: Stephan Mueller <smueller@chronox.de>
Tested-by: Romain Izard <romain.izard.pro@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2017-11-24 13:23:39 +08:00
..
internal crypto: hash - add crypto_(un)register_ahashes() 2017-08-22 14:54:52 +08:00
ablk_helper.h
acompress.h crypto: acomp - add driver-side scomp interface 2016-10-25 11:08:31 +08:00
aead.h crypto: doc - clarify AEAD memory structure 2016-12-13 16:38:06 -07:00
aes.h
akcipher.h crypto: akcipher - assume key is already set in maxsize 2017-06-10 12:04:29 +08:00
algapi.h crypto: algapi - make crypto_xor() take separate dst and src arguments 2017-08-04 09:27:15 +08:00
authenc.h
b128ops.h
blowfish.h
cast5.h
cast6.h
cast_common.h
cbc.h crypto: cbc - Export CBC implementation 2016-11-28 21:23:21 +08:00
chacha20.h crypto: chacha20 - convert generic and x86 versions to skcipher 2016-12-27 17:47:31 +08:00
cryptd.h crypto: cryptd - Add support for skcipher 2016-11-28 21:23:18 +08:00
crypto_wq.h
ctr.h
des.h
dh.h crypto: dh - return unsigned value for crypto_dh_key_len() 2017-10-12 22:55:05 +08:00
drbg.h crypto: drbg - move to generic async completion 2017-11-03 22:11:19 +08:00
ecdh.h crypto: ecdh - return unsigned value for crypto_ecdh_key_len() 2017-10-12 22:55:00 +08:00
engine.h crypto: engine - replace pr_xxx by dev_xxx 2017-06-19 14:19:54 +08:00
gcm.h crypto: gcm - add GCM IV size constant 2017-09-22 17:43:08 +08:00
gf128mul.h crypto: gf128mul - The x8_ble multiplication functions 2017-11-03 21:50:43 +08:00
ghash.h crypto: ghash-generic - move common definitions to a new header file 2016-10-02 22:26:40 +08:00
hash_info.h
hash.h crypto: doc - clarify return values for async hash methods 2017-09-22 17:43:03 +08:00
hmac.h crypto: hmac - add hmac IPAD/OPAD constant 2017-05-23 12:52:05 +08:00
if_alg.h crypto: af_alg - remove locking in async callback 2017-11-24 13:23:39 +08:00
kpp.h crypto: kpp - add get/set_flags helpers 2017-07-18 17:50:57 +08:00
lrw.h
mcryptd.h crypto: sha1-mb - async implementation for sha1-mb 2016-06-23 18:29:55 +08:00
md5.h
null.h crypto: null - Remove default null blkcipher 2016-07-18 17:35:44 +08:00
padlock.h
pcrypt.h
pkcs7.h PKCS#7: Make trust determination dependent on contents of trust keyring 2016-04-06 16:14:24 +01:00
poly1305.h
public_key.h KEYS: Keyring asymmetric key restrict method with chaining 2017-04-04 14:10:13 -07:00
rng.h
scatterwalk.h crypto: scatterwalk - Inline start/map/done 2016-07-18 17:35:50 +08:00
serpent.h
sha1_base.h
sha3.h crypto: sha3 - Add SHA-3 hash algorithm 2016-06-20 19:25:01 +08:00
sha256_base.h
sha512_base.h
sha.h
skcipher.h crypto: skcipher - introduce walksize attribute for SIMD algos 2016-12-30 19:52:47 +08:00
sm3_base.h crypto: sm3 - add OSCCA SM3 secure hash 2017-09-22 17:43:07 +08:00
sm3.h crypto: sm3 - add OSCCA SM3 secure hash 2017-09-22 17:43:07 +08:00
twofish.h
vmac.h
xts.h crypto: gf128mul - switch gf128mul_x_ble to le128 2017-04-05 21:58:37 +08:00