mirror of https://github.com/torvalds/linux.git
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:
|
||
|---|---|---|
| .. | ||
| internal | ||
| acompress.h | ||
| aead.h | ||
| aes.h | ||
| akcipher.h | ||
| algapi.h | ||
| arc4.h | ||
| asym_tpm_subtype.h | ||
| authenc.h | ||
| b128ops.h | ||
| blake2s.h | ||
| blowfish.h | ||
| cast5.h | ||
| cast6.h | ||
| cast_common.h | ||
| cbc.h | ||
| chacha.h | ||
| chacha20poly1305.h | ||
| cryptd.h | ||
| ctr.h | ||
| curve25519.h | ||
| des.h | ||
| dh.h | ||
| drbg.h | ||
| ecdh.h | ||
| engine.h | ||
| gcm.h | ||
| gf128mul.h | ||
| ghash.h | ||
| hash.h | ||
| hash_info.h | ||
| hmac.h | ||
| if_alg.h | ||
| kpp.h | ||
| md5.h | ||
| nhpoly1305.h | ||
| null.h | ||
| padlock.h | ||
| pcrypt.h | ||
| pkcs7.h | ||
| poly1305.h | ||
| public_key.h | ||
| rng.h | ||
| scatterwalk.h | ||
| serpent.h | ||
| sha.h | ||
| sha1_base.h | ||
| sha3.h | ||
| sha256_base.h | ||
| sha512_base.h | ||
| skcipher.h | ||
| sm3.h | ||
| sm3_base.h | ||
| sm4.h | ||
| streebog.h | ||
| twofish.h | ||
| xts.h | ||