]> git.ipfire.org Git - people/arne_f/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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 9 Sep 2018 08:32:42 +0000 (10:32 +0200)
commitdce1a2c6f33996d39e5cfbd4009db176bfa629de
tree4e2768f680dc073f48494e9c1cdc4a8502afbca6
parent61c8901dbf430b9d8b591ecc21ad2bbe740595a4
crypto: aesni - Use unaligned loads from gcm_context_data

commit e5b954e8d11fdde55eed35017370a3a0d8837754 upstream.

A regression was reported bisecting to 1476db2d12
"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: 1476db2d12 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/crypto/aesni-intel_asm.S