diff options
author | Hangbin Liu <liuhangbin@gmail.com> | 2021-06-03 08:53:40 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-07-14 17:56:06 +0300 |
commit | deef40c47e66a41c45dac93481e3b3751ab85123 (patch) | |
tree | 17d25bf9843aeddeecce3615c946206200f2de57 /crypto | |
parent | bc50c403859f379ddeed86eefe4e7a5d6c1548f2 (diff) | |
download | linux-deef40c47e66a41c45dac93481e3b3751ab85123.tar.xz |
crypto: x86/curve25519 - fix cpu feature checking logic in mod_exit
[ Upstream commit 1b82435d17774f3eaab35dce239d354548aa9da2 ]
In curve25519_mod_init() the curve25519_alg will be registered only when
(X86_FEATURE_BMI2 && X86_FEATURE_ADX). But in curve25519_mod_exit()
it still checks (X86_FEATURE_BMI2 || X86_FEATURE_ADX) when do crypto
unregister. This will trigger a BUG_ON in crypto_unregister_alg() as
alg->cra_refcnt is 0 if the cpu only supports one of X86_FEATURE_BMI2
and X86_FEATURE_ADX.
Fixes: 07b586fe0662 ("crypto: x86/curve25519 - replace with formally verified implementation")
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Reviewed-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'crypto')
0 files changed, 0 insertions, 0 deletions