Skip to content

Commit

Permalink
crypto: chacha20-ssse3 - Align stack pointer to 64 bytes
Browse files Browse the repository at this point in the history
This aligns the stack pointer in chacha20_4block_xor_ssse3 to 64 bytes.
Fixes general protection faults and potential kernel panics.

Cc: stable@vger.kernel.org
Signed-off-by: Eli Cooper <elicooper@gmx.com>
Acked-by: Martin Willi <martin@strongswan.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
  • Loading branch information
Eli Cooper authored and Herbert Xu committed Jan 25, 2016
1 parent 7ee7014 commit cbe09bd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions arch/x86/crypto/chacha20-ssse3-x86_64.S
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,9 @@ ENTRY(chacha20_4block_xor_ssse3)
# done with the slightly better performing SSSE3 byte shuffling,
# 7/12-bit word rotation uses traditional shift+OR.

sub $0x40,%rsp
mov %rsp,%r11
sub $0x80,%rsp
and $~63,%rsp

# x0..15[0-3] = s0..3[0..3]
movq 0x00(%rdi),%xmm1
Expand Down Expand Up @@ -620,6 +622,6 @@ ENTRY(chacha20_4block_xor_ssse3)
pxor %xmm1,%xmm15
movdqu %xmm15,0xf0(%rsi)

add $0x40,%rsp
mov %r11,%rsp
ret
ENDPROC(chacha20_4block_xor_ssse3)

0 comments on commit cbe09bd

Please sign in to comment.