Skip to content

Commit 92b2790

Browse files
bwhacksherbertx
authored andcommitted
crypto: camellia_aesni_avx - Fix CPU feature checks
We need to explicitly check the AVX and AES CPU features, as we can't infer them from the related XSAVE feature flags. For example, the Core i3 2310M passes the XSAVE feature test but does not implement AES-NI. Reported-and-tested-by: Stéphane Glondu <glondu@debian.org> References: https://bugs.debian.org/800934 Fixes: ce4f5f9 ("x86/fpu, crypto x86/camellia_aesni_avx: Simplify...") Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Cc: stable <stable@vger.kernel.org> # 4.2 Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent a66d7f7 commit 92b2790

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

arch/x86/crypto/camellia_aesni_avx_glue.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,11 @@ static int __init camellia_aesni_init(void)
554554
{
555555
const char *feature_name;
556556

557+
if (!cpu_has_avx || !cpu_has_aes || !cpu_has_osxsave) {
558+
pr_info("AVX or AES-NI instructions are not detected.\n");
559+
return -ENODEV;
560+
}
561+
557562
if (!cpu_has_xfeatures(XSTATE_SSE | XSTATE_YMM, &feature_name)) {
558563
pr_info("CPU feature '%s' is not supported.\n", feature_name);
559564
return -ENODEV;

0 commit comments

Comments
 (0)