linux/include/crypto
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
..
internal FROMLIST: crypto: shash - stop comparing function pointers to avoid breaking CFI 2021-06-11 07:49:58 +00:00
acompress.h crypto: api - check for ERR pointers in crypto_destroy_tfm() 2021-05-11 14:47:16 +02:00
aead.h crypto: api - check for ERR pointers in crypto_destroy_tfm() 2021-05-11 14:47:16 +02:00
aes.h
akcipher.h crypto: api - check for ERR pointers in crypto_destroy_tfm() 2021-05-11 14:47:16 +02:00
algapi.h UPSTREAM: crypto: remove cipher routines from public crypto API 2021-05-13 07:53:31 +00:00
arc4.h
asym_tpm_subtype.h
authenc.h
b128ops.h
blake2b.h UPSTREAM: crypto: blake2b - sync with blake2s implementation 2021-02-23 08:06:20 +01:00
blake2s.h UPSTREAM: crypto: blake2s - include <linux/bug.h> instead of <asm/bug.h> 2021-02-23 08:06:19 +01:00
blowfish.h
cast_common.h
cast5.h
cast6.h
chacha.h random: initialize ChaCha20 constants with correct endianness 2021-05-11 14:47:19 +02:00
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_info.h
hash.h crypto: api - check for ERR pointers in crypto_destroy_tfm() 2021-05-11 14:47:16 +02:00
hmac.h
if_alg.h
kpp.h crypto: api - check for ERR pointers in crypto_destroy_tfm() 2021-05-11 14:47:16 +02:00
md5.h
nhpoly1305.h
null.h
padlock.h
pcrypt.h
pkcs7.h
poly1305.h crypto: poly1305 - fix poly1305_core_setkey() declaration 2021-05-14 09:50:13 +02:00
public_key.h
rng.h crypto: api - check for ERR pointers in crypto_destroy_tfm() 2021-05-11 14:47:16 +02:00
scatterwalk.h
serpent.h
sha.h
sha1_base.h
sha3.h
sha256_base.h
sha512_base.h
skcipher.h crypto: api - check for ERR pointers in crypto_destroy_tfm() 2021-05-11 14:47:16 +02:00
sm2.h
sm3_base.h
sm3.h
sm4.h
streebog.h
twofish.h
xts.h