android_kernel_motorola_sm6375/include/crypto
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Ard Biesheuvel 80b9d3becd 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:53:13 +02:00
..
internal crypto: shash - avoid comparing pointers to exported functions under CFI 2021-07-14 16:53:13 +02:00
acompress.h crypto: api - check for ERR pointers in crypto_destroy_tfm() 2021-05-11 14:04:05 +02:00
aead.h crypto: api - check for ERR pointers in crypto_destroy_tfm() 2021-05-11 14:04:05 +02:00
aes.h
akcipher.h crypto: api - check for ERR pointers in crypto_destroy_tfm() 2021-05-11 14:04:05 +02:00
algapi.h
arc4.h
asym_tpm_subtype.h
authenc.h
b128ops.h
blowfish.h
cast5.h
cast6.h crypto: x86 - Regularize glue function prototypes 2021-03-20 10:39:47 +01:00
cast_common.h
cbc.h
chacha.h
cryptd.h
ctr.h
des.h
dh.h
drbg.h
ecdh.h
engine.h
gcm.h
gf128mul.h
ghash.h
hash.h crypto: api - check for ERR pointers in crypto_destroy_tfm() 2021-05-11 14:04:05 +02:00
hash_info.h
hmac.h
if_alg.h crypto: algif_aead - Only wake up when ctx->more is zero 2020-08-21 13:05:30 +02:00
kpp.h crypto: api - check for ERR pointers in crypto_destroy_tfm() 2021-05-11 14:04:05 +02:00
md5.h
nhpoly1305.h
null.h
padlock.h
pcrypt.h
pkcs7.h
poly1305.h
public_key.h
rng.h crypto: api - check for ERR pointers in crypto_destroy_tfm() 2021-05-11 14:04:05 +02:00
scatterwalk.h
serpent.h crypto: x86 - Regularize glue function prototypes 2021-03-20 10:39:47 +01:00
sha.h crypto: sha256 - Remove sha256/224_init code duplication 2019-09-05 14:54:54 +10:00
sha1_base.h
sha3.h
sha256_base.h crypto: sha256 - Remove sha256/224_init code duplication 2019-09-05 14:54:54 +10:00
sha512_base.h
skcipher.h crypto: api - check for ERR pointers in crypto_destroy_tfm() 2021-05-11 14:04:05 +02:00
sm3.h
sm3_base.h
sm4.h
streebog.h
twofish.h
xts.h crypto: x86 - Regularize glue function prototypes 2021-03-20 10:39:47 +01:00