linux/include/crypto
Herbert Xu 34c86f4c4a crypto: af_alg - fix use-after-free in af_alg_accept() due to bh_lock_sock()
The locking in af_alg_release_parent is broken as the BH socket
lock can only be taken if there is a code-path to handle the case
where the lock is owned by process-context.  Instead of adding
such handling, we can fix this by changing the ref counts to
atomic_t.

This patch also modifies the main refcnt to include both normal
and nokey sockets.  This way we don't have to fudge the nokey
ref count when a socket changes from nokey to normal.

Credits go to Mauricio Faria de Oliveira who diagnosed this bug
and sent a patch for it:

https://lore.kernel.org/linux-crypto/20200605161657.535043-1-mfo@canonical.com/

Reported-by: Brian Moyles <bmoyles@netflix.com>
Reported-by: Mauricio Faria de Oliveira <mfo@canonical.com>
Fixes: 37f96694cf ("crypto: af_alg - Use bh_lock_sock in...")
Cc: <stable@vger.kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2020-06-18 17:09:54 +10:00
..
internal crypto: poly1305 - add new 32 and 64-bit generic versions 2020-01-16 15:18:12 +08:00
acompress.h crypto: acomp - search acomp with scomp backend in crypto_has_acomp 2020-05-08 15:30:41 +10:00
aead.h crypto: aead - improve documentation for scatterlist layout 2020-03-12 23:00:13 +11:00
aes.h crypto: aes - helper function to validate key length for AES algorithms 2019-08-09 15:11:43 +10:00
akcipher.h
algapi.h crypto: algapi - create function to add request in front of queue 2020-05-08 15:30:40 +10:00
arc4.h crypto: arc4 - refactor arc4 core code into separate library 2019-06-20 14:18:33 +08:00
asym_tpm_subtype.h
authenc.h
b128ops.h
blake2s.h crypto: blake2s - generic C library implementation and selftest 2019-11-17 09:02:42 +08:00
blowfish.h
cast5.h
cast6.h crypto: remove CRYPTO_TFM_RES_BAD_KEY_LEN 2020-01-09 11:30:53 +08:00
cast_common.h
cbc.h
chacha.h crypto: x86/chacha - expose SIMD ChaCha routine as library function 2019-11-17 09:02:39 +08:00
chacha20poly1305.h crypto: lib/chacha20poly1305 - reimplement crypt_from_sg() routine 2019-11-17 09:02:44 +08:00
cryptd.h
ctr.h crypto: ctr - add helper for performing a CTR encryption walk 2019-07-26 14:56:07 +10:00
curve25519.h crypto: curve25519 - do not pollute dispatcher based on assembler 2020-04-09 00:01:59 +09:00
des.h crypto: des - remove now unused __des3_ede_setkey() 2019-08-22 14:57:33 +10:00
dh.h
drbg.h crypto: drbg - always seeded with SP800-90B compliant noise source 2020-04-24 17:42:17 +10:00
ecdh.h
engine.h crypto: engine - support for batch requests 2020-05-08 15:30:40 +10:00
gcm.h crypto: gcm - helper functions for assoclen/authsize check 2019-08-09 15:11:41 +10:00
gf128mul.h
ghash.h crypto: ghash - add comment and improve help text 2019-07-27 21:08:38 +10:00
hash.h crypto: hash - introduce crypto_shash_tfm_digest() 2020-05-08 15:32:12 +10:00
hash_info.h
hmac.h
if_alg.h crypto: af_alg - fix use-after-free in af_alg_accept() due to bh_lock_sock() 2020-06-18 17:09:54 +10:00
kpp.h
md5.h
nhpoly1305.h crypto: poly1305 - add new 32 and 64-bit generic versions 2020-01-16 15:18:12 +08:00
null.h
padlock.h
pcrypt.h
pkcs7.h PKCS#7: Introduce pkcs7_get_digest() 2019-08-05 18:40:19 -04:00
poly1305.h crypto: poly1305 - add new 32 and 64-bit generic versions 2020-01-16 15:18:12 +08:00
public_key.h
rng.h
scatterwalk.h
serpent.h crypto: x86 - Regularize glue function prototypes 2019-12-11 16:36:54 +08:00
sha.h crypto: lib/sha1 - fold linux/cryptohash.h into crypto/sha.h 2020-05-08 15:32:17 +10:00
sha1_base.h crypto: add header include guards 2019-08-02 14:44:02 +10:00
sha3.h
sha256_base.h crypto: lib/sha256 - return void 2020-05-08 15:32:12 +10:00
sha512_base.h crypto: add header include guards 2019-08-02 14:44:02 +10:00
skcipher.h crypto: skcipher - add crypto_skcipher_min_keysize() 2019-12-11 16:37:00 +08:00
sm3.h
sm3_base.h crypto: add header include guards 2019-08-02 14:44:02 +10:00
sm4.h
streebog.h
twofish.h crypto: remove CRYPTO_TFM_RES_BAD_KEY_LEN 2020-01-09 11:30:53 +08:00
xts.h crypto: remove CRYPTO_TFM_RES_WEAK_KEY 2020-01-09 11:30:53 +08:00