From 8a0f796921799ec47e6066a112d636af81572866 Mon Sep 17 00:00:00 2001 From: wangshouping Date: Wed, 26 Jan 2022 20:00:05 +0800 Subject: [PATCH] crypto: Add PMULL judgment during initialization to prevent oops openEuler inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I4OKIE?from=project-issue CVE: NA ---------------------------------------- For servers that do not support PMULL on the cpu, execute "modprobe crct10dif-ce", and accur oops. Signed-off-by: wangshouping Reviewed-by: Yue Haibing Signed-off-by: Zheng Zengkai --- arch/arm64/crypto/crct10dif-neon_glue.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/arm64/crypto/crct10dif-neon_glue.c b/arch/arm64/crypto/crct10dif-neon_glue.c index e0c4a9acee27..af731b3ec30e 100644 --- a/arch/arm64/crypto/crct10dif-neon_glue.c +++ b/arch/arm64/crypto/crct10dif-neon_glue.c @@ -97,7 +97,11 @@ static struct shash_alg alg = { static int __init crct10dif_arm64_mod_init(void) { - return crypto_register_shash(&alg); + if (cpu_have_named_feature(PMULL)) { + return crypto_register_shash(&alg); + } else { + return -ENODEV; + } } static void __exit crct10dif_arm64_mod_fini(void) -- GitLab