]> git.ipfire.org Git - people/arne_f/kernel.git/commit
crypto: arm64/sm4-ce - check for the right CPU feature bit
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Tue, 7 Aug 2018 21:18:36 +0000 (23:18 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 9 Sep 2018 08:32:42 +0000 (10:32 +0200)
commit26b165edc3e43df104cacadc9e9760c812a2b202
tree7c1af38237c476156c611e061809213494da2e66
parentdce1a2c6f33996d39e5cfbd4009db176bfa629de
crypto: arm64/sm4-ce - check for the right CPU feature bit

commit 7fa885e2a22fd0f91a2c23d9275f5021f618ff5a upstream.

ARMv8.2 specifies special instructions for the SM3 cryptographic hash
and the SM4 symmetric cipher. While it is unlikely that a core would
implement one and not the other, we should only use SM4 instructions
if the SM4 CPU feature bit is set, and we currently check the SM3
feature bit instead. So fix that.

Fixes: e99ce921c468 ("crypto: arm64 - add support for SM4...")
Cc: <stable@vger.kernel.org>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm64/crypto/sm4-ce-glue.c