]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: aesni - Use unaligned loads from gcm_context_data
authorDave Watson <davejwatson@fb.com>
Wed, 15 Aug 2018 17:29:42 +0000 (10:29 -0700)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sat, 25 Aug 2018 11:50:42 +0000 (19:50 +0800)
commit21655d232205c4b2a6409f913946a33b497bdc76
tree414336a7951061bec987fd8b83bd4662df6ef0c4
parent6fd38f6edd8036ac0cedf47efc9d65c5a6f4391e
crypto: aesni - Use unaligned loads from gcm_context_data

A regression was reported bisecting to f3439248fb
"Move HashKey computation from stack to gcm_context".  That diff
moved HashKey computation from the stack, which was explicitly aligned
in the asm, to a struct provided from the C code, depending on
AESNI_ALIGN_ATTR for alignment.   It appears some compilers may not
align this struct correctly, resulting in a crash on the movdqa
instruction when attempting to encrypt or decrypt data.

Fix by using unaligned loads for the HashKeys.  On modern
hardware there is no perf difference between the unaligned and
aligned loads.  All other accesses to gcm_context_data already use
unaligned loads.

Reported-by: Mauro Rossi <issor.oruam@gmail.com>
Fixes: f3439248fb ("Move HashKey computation from stack to gcm_context")
Cc: <stable@vger.kernel.org>
Signed-off-by: Dave Watson <davejwatson@fb.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
arch/x86/crypto/aesni-intel_asm.S