kernel_optimize_test/include/crypto
Ard Biesheuvel c34f3912a7 crypto: shash - avoid comparing pointers to exported functions under CFI
[ Upstream commit 22ca9f4aaf431a9413dcc115dd590123307f274f ]

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.

Cc: Sami Tolvanen <samitolvanen@google.com>
Cc: Eric Biggers <ebiggers@kernel.org>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Sami Tolvanen <samitolvanen@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-07-14 16:55:54 +02:00
..
internal crypto: shash - avoid comparing pointers to exported functions under CFI 2021-07-14 16:55:54 +02:00
acompress.h
aead.h
aes.h
akcipher.h
algapi.h
arc4.h
asym_tpm_subtype.h
authenc.h
b128ops.h
blake2s.h
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
hmac.h
if_alg.h
kpp.h
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
scatterwalk.h
serpent.h
sha.h
sha1_base.h
sha3.h
sha256_base.h
sha512_base.h
skcipher.h
sm2.h
sm3_base.h
sm3.h
sm4.h
streebog.h
twofish.h
xts.h