android_kernel_xiaomi_sm8450/include/crypto/internal
Ard Biesheuvel 0672a69424 FROMLIST: crypto: shash - stop comparing function pointers to avoid breaking CFI
crypto_shash_alg_has_setkey() is implemented by testing whether the
.setkey() member of a struct shash_alg points to the default version
called shash_no_setkey(). As crypto_shash_alg_has_setkey() is a static
inline, this requires shash_no_setkey() to be exported to modules.

Unfortunately, when building with CFI, function pointers are routed
via CFI stubs which are private to each module (or to the kernel proper)
and so this function pointer comparison may fail spuriously.

Let's fix this by turning crypto_shash_alg_has_setkey() into an out of
line function, which makes the problem go away.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Bug: 153614920
Bug: 188620248
Link: https://lore.kernel.org/linux-crypto/20210610062150.212779-1-ardb@kernel.org
Change-Id: Ib94d812e2668020144bf8246ddbbc8b652cdf2b7
Signed-off-by: Ard Biesheuvel <ardb@google.com>
2021-06-11 07:49:58 +00:00
..
acompress.h mm, treewide: rename kzfree() to kfree_sensitive() 2020-08-07 11:33:22 -07:00
aead.h crypto: aead - pass instance to crypto_grab_aead() 2020-01-09 11:30:54 +08:00
akcipher.h crypto: akcipher - pass instance to crypto_grab_akcipher() 2020-01-09 11:30:54 +08:00
blake2b.h UPSTREAM: crypto: blake2b - sync with blake2s implementation 2021-02-23 08:06:20 +01:00
blake2s.h UPSTREAM: crypto: blake2s - adjust include guard naming 2021-02-23 08:06:19 +01:00
chacha.h crypto: chacha - fix warning message in header file 2019-12-11 16:48:38 +08:00
cipher.h UPSTREAM: crypto: remove cipher routines from public crypto API 2021-05-13 07:53:31 +00:00
cryptouser.h crypto: user - fix potential warnings in cryptouser.h 2019-08-02 14:44:31 +10:00
des.h crypto: remove CRYPTO_TFM_RES_WEAK_KEY 2020-01-09 11:30:53 +08:00
geniv.h crypto: geniv - remove unneeded arguments from aead_geniv_alloc() 2020-07-16 21:49:07 +10:00
hash.h FROMLIST: crypto: shash - stop comparing function pointers to avoid breaking CFI 2021-06-11 07:49:58 +00:00
kpp.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
poly1305.h crypto: poly1305 - fix poly1305_core_setkey() declaration 2021-05-14 09:50:13 +02:00
rng.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
rsa.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
scompress.h crypto: algapi - make unregistration functions return void 2019-12-20 14:58:35 +08:00
simd.h crypto: simd,testmgr - introduce crypto_simd_usable() 2019-03-22 20:57:27 +08:00
skcipher.h UPSTREAM: crypto: remove cipher routines from public crypto API 2021-05-13 07:53:31 +00:00