android_kernel_sony_sdm845/crypto
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Jia-Ju Bai 79d47dd686 crypto: shash - Fix a sleep-in-atomic bug in shash_setkey_unaligned
[ Upstream commit 9039f3ef446e9ffa200200c934f049add9e58426 ]

The SCTP program may sleep under a spinlock, and the function call path is:
sctp_generate_t3_rtx_event (acquire the spinlock)
  sctp_do_sm
    sctp_side_effects
      sctp_cmd_interpreter
        sctp_make_init_ack
          sctp_pack_cookie
            crypto_shash_setkey
              shash_setkey_unaligned
                kmalloc(GFP_KERNEL)

For the same reason, the orinoco driver may sleep in interrupt handler,
and the function call path is:
orinoco_rx_isr_tasklet
  orinoco_rx
    orinoco_mic
      crypto_shash_setkey
        shash_setkey_unaligned
          kmalloc(GFP_KERNEL)

To fix it, GFP_KERNEL is replaced with GFP_ATOMIC.
This bug is found by my static analysis tool and my code review.

Signed-off-by: Jia-Ju Bai <baijiaju1990@163.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2018-11-10 07:42:59 -08:00
..
asymmetric_keys Replace magic for trusting the secondary keyring with #define 2018-09-09 20:01:23 +02:00
async_tx async_tx: Fix DMA_PREP_FENCE usage in do_async_gen_syndrome() 2018-04-13 19:47:58 +02:00
.gitignore
842.c
ablk_helper.c
ablkcipher.c crypto: skcipher - Fix -Wstringop-truncation warnings 2018-10-03 17:01:41 -07:00
aead.c
aes_generic.c
af_alg.c crypto: af_alg - fix possible uninit-value in alg_bind() 2018-05-16 10:08:40 +02:00
ahash.c crypto: ahash - Fix early termination in hash walk 2018-04-08 12:12:57 +02:00
akcipher.c
algapi.c crypto: algapi - fix NULL dereference in crypto_remove_spawns() 2018-01-17 09:38:54 +01:00
algboss.c
algif_aead.c crypto: algif_aead - Require setkey before accept(2) 2017-05-20 14:28:37 +02:00
algif_hash.c crypto: hash - prevent using keyed hashes without setting key 2018-02-25 11:05:44 +01:00
algif_rng.c
algif_skcipher.c crypto: AF_ALG - remove SGL terminator indicator when chaining 2017-09-27 14:39:20 +02:00
ansi_cprng.c
anubis.c
api.c evm: Don't deadlock if a crypto algorithm is unavailable 2018-09-26 08:36:37 +02:00
arc4.c
authenc.c crypto: authenc - don't leak pointers to authenc keys 2018-08-03 07:55:25 +02:00
authencesn.c crypto: authencesn - don't leak pointers to authenc keys 2018-08-03 07:55:25 +02:00
blkcipher.c crypto: skcipher - Fix -Wstringop-truncation warnings 2018-10-03 17:01:41 -07:00
blowfish_common.c
blowfish_generic.c
camellia_generic.c
cast5_generic.c
cast6_generic.c
cast_common.c
cbc.c
ccm.c crypto: ccm - preserve the IV buffer 2017-11-15 15:53:18 +01:00
chacha20_generic.c
chacha20poly1305.c crypto: chacha20poly1305 - validate the digest size 2018-01-10 09:29:51 +01:00
cipher.c
cmac.c
compress.c
crc32_generic.c crypto: hash - annotate algorithms taking optional key 2018-02-25 11:05:43 +01:00
crc32c_generic.c crypto: hash - annotate algorithms taking optional key 2018-02-25 11:05:43 +01:00
crct10dif_common.c
crct10dif_generic.c
cryptd.c crypto: hash - annotate algorithms taking optional key 2018-02-25 11:05:43 +01:00
crypto_engine.c
crypto_null.c
crypto_user.c
crypto_wq.c
ctr.c
cts.c
deflate.c
des_generic.c
dh.c crypto: dh - Fix double free of ctx->p 2017-11-24 08:33:41 +01:00
dh_helper.c crypto: dh - Don't permit 'key' or 'g' size longer than 'p' 2017-11-21 09:23:29 +01:00
drbg.c crypto: drbg - set freed buffers to NULL 2018-05-01 15:13:08 -07:00
ecb.c
ecc.c
ecc.h
ecc_curve_defs.h
ecdh.c
ecdh_helper.c
echainiv.c
fcrypt.c
fips.c
gcm.c crypto: gcm - wait for crypto op not signal safe 2017-06-14 15:05:55 +02:00
gf128mul.c
ghash-generic.c
hash_info.c
hmac.c crypto: hmac - require that the underlying hash algorithm is unkeyed 2017-12-20 10:07:15 +01:00
internal.h
jitterentropy-kcapi.c
jitterentropy.c
Kconfig crypto: ecdh - fix typo in KPP dependency of CRYPTO_ECDH 2018-02-03 17:05:34 +01:00
keywrap.c
khazad.c
kpp.c
lrw.c
lz4.c
lz4hc.c
lzo.c
Makefile crypto: improve gcc optimization flags for serpent and wp512 2017-03-18 19:14:26 +08:00
mcryptd.c crypto: hash - annotate algorithms taking optional key 2018-02-25 11:05:43 +01:00
md4.c
md5.c
memneq.c
michael_mic.c
pcbc.c
pcrypt.c crypto: pcrypt - fix freeing pcrypt instances 2018-01-10 09:29:51 +01:00
poly1305_generic.c crypto: poly1305 - remove ->setkey() method 2018-02-17 13:21:15 +01:00
proc.c
ripemd.h
rmd128.c
rmd160.c
rmd256.c
rmd320.c
rng.c
rsa-pkcs1pad.c crypto: rsa-pkcs1pad - use constant time memory comparison for MACs 2017-07-15 12:16:16 +02:00
rsa.c
rsa_helper.c crypto: rsa - fix buffer overread when stripping leading zeroes 2017-12-20 10:07:15 +01:00
rsaprivkey.asn1
rsapubkey.asn1
salsa20_generic.c crypto: salsa20 - fix blkcipher_walk API usage 2017-12-20 10:07:15 +01:00
scatterwalk.c
seed.c
seqiv.c
serpent_generic.c
sha1_generic.c
sha3_generic.c crypto: sha3-generic - fixes for alignment and big endian operation 2018-02-03 17:05:34 +01:00
sha256_generic.c
sha512_generic.c
shash.c crypto: shash - Fix a sleep-in-atomic bug in shash_setkey_unaligned 2018-11-10 07:42:59 -08:00
skcipher.c crypto: skcipher - Add missing API setkey checks 2017-06-07 12:07:46 +02:00
tcrypt.c crypto: tcrypt - fix S/G table for test_aead_speed() 2018-02-13 12:36:02 +01:00
tcrypt.h
tea.c
testmgr.c
testmgr.h
tgr192.c
twofish_common.c
twofish_generic.c
vmac.c crypto: vmac - separate tfm and request context 2018-08-17 20:59:29 +02:00
wp512.c
xcbc.c
xor.c
xts.c