Skip to content

Commit cbe09bd

Browse files
Eli Cooperherbertx
authored andcommitted
crypto: chacha20-ssse3 - Align stack pointer to 64 bytes
This aligns the stack pointer in chacha20_4block_xor_ssse3 to 64 bytes. Fixes general protection faults and potential kernel panics. Cc: [email protected] Signed-off-by: Eli Cooper <[email protected]> Acked-by: Martin Willi <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent 7ee7014 commit cbe09bd

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

arch/x86/crypto/chacha20-ssse3-x86_64.S

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,9 @@ ENTRY(chacha20_4block_xor_ssse3)
157157
# done with the slightly better performing SSSE3 byte shuffling,
158158
# 7/12-bit word rotation uses traditional shift+OR.
159159

160-
sub $0x40,%rsp
160+
mov %rsp,%r11
161+
sub $0x80,%rsp
162+
and $~63,%rsp
161163

162164
# x0..15[0-3] = s0..3[0..3]
163165
movq 0x00(%rdi),%xmm1
@@ -620,6 +622,6 @@ ENTRY(chacha20_4block_xor_ssse3)
620622
pxor %xmm1,%xmm15
621623
movdqu %xmm15,0xf0(%rsi)
622624

623-
add $0x40,%rsp
625+
mov %r11,%rsp
624626
ret
625627
ENDPROC(chacha20_4block_xor_ssse3)

0 commit comments

Comments
 (0)