Skip to content

Commit

Permalink
crypto: x86 - Add missing RETs
Browse files Browse the repository at this point in the history
Add explicit RETs to the tail calls of AEGIS and MORUS crypto algorithms
otherwise they run into INT3 padding due to

  ("x86/asm: Pad assembly functions with INT3 instructions")

leading to spurious debug exceptions.

Mike Galbraith <efault@gmx.de> took care of all the remaining callsites.

Signed-off-by: Borislav Petkov <bp@suse.de>
Acked-by: Ondrej Mosnacek <omosnacek@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
  • Loading branch information
Borislav Petkov authored and Herbert Xu committed Jul 1, 2018
1 parent a068b94 commit 221e00d
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions arch/x86/crypto/aegis128-aesni-asm.S
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,7 @@ ENTRY(crypto_aegis128_aesni_enc_tail)
movdqu STATE3, 0x40(STATEP)

FRAME_END
ret
ENDPROC(crypto_aegis128_aesni_enc_tail)

.macro decrypt_block a s0 s1 s2 s3 s4 i
Expand Down
1 change: 1 addition & 0 deletions arch/x86/crypto/aegis128l-aesni-asm.S
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,7 @@ ENTRY(crypto_aegis128l_aesni_enc_tail)
state_store0

FRAME_END
ret
ENDPROC(crypto_aegis128l_aesni_enc_tail)

/*
Expand Down
1 change: 1 addition & 0 deletions arch/x86/crypto/aegis256-aesni-asm.S
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,7 @@ ENTRY(crypto_aegis256_aesni_enc_tail)
state_store0

FRAME_END
ret
ENDPROC(crypto_aegis256_aesni_enc_tail)

/*
Expand Down
1 change: 1 addition & 0 deletions arch/x86/crypto/morus1280-avx2-asm.S
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@ ENTRY(crypto_morus1280_avx2_enc_tail)
vmovdqu STATE4, (4 * 32)(%rdi)

FRAME_END
ret
ENDPROC(crypto_morus1280_avx2_enc_tail)

/*
Expand Down
1 change: 1 addition & 0 deletions arch/x86/crypto/morus1280-sse2-asm.S
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,7 @@ ENTRY(crypto_morus1280_sse2_enc_tail)
movdqu STATE4_HI, (9 * 16)(%rdi)

FRAME_END
ret
ENDPROC(crypto_morus1280_sse2_enc_tail)

/*
Expand Down
1 change: 1 addition & 0 deletions arch/x86/crypto/morus640-sse2-asm.S
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,7 @@ ENTRY(crypto_morus640_sse2_enc_tail)
movdqu STATE4, (4 * 16)(%rdi)

FRAME_END
ret
ENDPROC(crypto_morus640_sse2_enc_tail)

/*
Expand Down

0 comments on commit 221e00d

Please sign in to comment.