]> 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)
commitb91397de7bbd12174c7cbada6cf61de88e86e8e3
tree414336a7951061bec987fd8b83bd4662df6ef0c4
parent5ab7cf3e84540a943f92b6f3b52b98e3e77e1edc
crypto: aesni - Use unaligned loads from gcm_context_data

A regression was reported bisecting to 9a13fd611a
"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: 9a13fd611a ("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