Skip to content

Commit

Permalink
crypto: sha256_ssse3 - fix stack corruption with SSSE3 and AVX implem…
Browse files Browse the repository at this point in the history
…entations

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 <[email protected]>
Signed-off-by: Jussi Kivilinna <[email protected]>
Tested-by: Julian Wollrath <[email protected]>
Acked-by: Tim Chen <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
jkivilin authored and herbertx committed May 28, 2013
1 parent 286233e commit de614e5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion arch/x86/crypto/sha256-avx-asm.S
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/crypto/sha256-ssse3-asm.S
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit de614e5

Please sign in to comment.