]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
crypto: sha256_ssse3 - fix stack corruption with SSSE3 and AVX implementations
authorJussi Kivilinna <jussi.kivilinna@iki.fi>
Tue, 21 May 2013 14:09:41 +0000 (17:09 +0300)
committerHerbert Xu <herbert@gondor.apana.org.au>
Tue, 28 May 2013 05:46:47 +0000 (13:46 +0800)
The _XFER stack element size was set too small, 8 bytes, when it needs to be
16 bytes. As _XFER is the last stack element used by these implementations,
the 16 byte stores with 'movdqa' corrupt the stack where the value of register
%r12 is temporarily stored. As these implementations align the stack pointer
to 16 bytes, this corruption did not happen every time.

Patch corrects this issue.

Reported-by: Julian Wollrath <jwollrath@web.de>
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
Tested-by: Julian Wollrath <jwollrath@web.de>
Acked-by: Tim Chen <tim.c.chen@linux.intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
arch/x86/crypto/sha256-avx-asm.S
arch/x86/crypto/sha256-ssse3-asm.S

index 56610c4bf31b22a47ef58a0362fcabe3cd8437f8..642f15687a0ac4205f59850cacab030768eaf6d4 100644 (file)
@@ -118,7 +118,7 @@ y2 = %r15d
 
 _INP_END_SIZE = 8
 _INP_SIZE = 8
-_XFER_SIZE = 8
+_XFER_SIZE = 16
 _XMM_SAVE_SIZE = 0
 
 _INP_END = 0
index 98d3c391da81b5de50469c7c0d4c33afb7e90b8a..f833b74d902ba87919184ba7828b226ee067c096 100644 (file)
@@ -111,7 +111,7 @@ y2 = %r15d
 
 _INP_END_SIZE = 8
 _INP_SIZE = 8
-_XFER_SIZE = 8
+_XFER_SIZE = 16
 _XMM_SAVE_SIZE = 0
 
 _INP_END = 0