Skip to contentSkip to conversation

Patch "crypto: camellia_aesni_avx - Fix CPU feature checks" has been added to the 4.2-stable tree

PATCH [email protected] 1 participant 1 message Oct 23, 2015

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

crypto: camellia_aesni_avx - Fix CPU feature checks

to the 4.2-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
crypto-camellia_aesni_avx-fix-cpu-feature-checks.patch
and it can be found in the queue-4.2 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 92b279070dd6c94265db32748bbeb5b583588de9 Mon Sep 17 00:00:00 2001

From: Ben Hutchings <[email protected]>
Date: Tue, 6 Oct 2015 12:31:33 +0100
Subject: crypto: camellia_aesni_avx - Fix CPU feature checks
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

From: Ben Hutchings <[email protected]>

commit 92b279070dd6c94265db32748bbeb5b583588de9 upstream.

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.

References: https://bugs.debian.org/800934

Fixes ce4f5f9b65ae ("x86/fpu, crypto x86/camellia_aesni_avx: Simplify...")
---
 arch/x86/crypto/camellia_aesni_avx_glue.c |    5 +++++
 1 file changed, 5 insertions(+)
arch/x86/crypto/camellia_aesni_avx_glue.c +5 -0
@@ -554,6 +554,11 @@ static int __init camellia_aesni_init(vo
 {
 	const char *feature_name;
 
+	if (!cpu_has_avx || !cpu_has_aes || !cpu_has_osxsave) {
+		pr_info("AVX or AES-NI instructions are not detected.\n");
+		return -ENODEV;
+	}
+
 	if (!cpu_has_xfeatures(XSTATE_SSE | XSTATE_YMM, &feature_name)) {
 		pr_info("CPU feature '%s' is not supported.\n", feature_name);
 		return -ENODEV;

Patches currently in stable-queue which might be from [email protected] are

queue-4.2/ethtool-use-kcalloc-instead-of-kmalloc-for-ethtool_get_strings.patch queue-4.2/crypto-camellia_aesni_avx-fix-cpu-feature-checks.patch