lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 18 Sep 2017 14:42:11 -0500
From:   Josh Poimboeuf <>
To:     Herbert Xu <>,
        "David S. Miller" <>
        Tim Chen <>,
        Mathias Krause <>,
        Jussi Kivilinna <>,
        Peter Zijlstra <>,, Eric Biggers <>,
        Andy Lutomirski <>, Jiri Slaby <>
Subject: [PATCH v2 12/12] x86/crypto: Fix RBP usage in twofish-avx-x86_64-asm_64.S

Using RBP as a temporary register breaks frame pointer convention and
breaks stack traces when unwinding from an interrupt in the crypto code.

Use R13 instead of RBP.  Both are callee-saved registers, so the
substitution is straightforward.

Reported-by: Eric Biggers <>
Reported-by: Peter Zijlstra <>
Tested-by: Eric Biggers <>
Acked-by: Eric Biggers <>
Signed-off-by: Josh Poimboeuf <>
 arch/x86/crypto/twofish-avx-x86_64-asm_64.S | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/x86/crypto/twofish-avx-x86_64-asm_64.S b/arch/x86/crypto/twofish-avx-x86_64-asm_64.S
index b3f49d286348..73b471da3622 100644
--- a/arch/x86/crypto/twofish-avx-x86_64-asm_64.S
+++ b/arch/x86/crypto/twofish-avx-x86_64-asm_64.S
@@ -76,8 +76,8 @@
 #define RT %xmm14
 #define RR %xmm15
-#define RID1  %rbp
-#define RID1d %ebp
+#define RID1  %r13
+#define RID1d %r13d
 #define RID2  %rsi
 #define RID2d %esi
@@ -259,7 +259,7 @@ __twofish_enc_blk8:
 	vmovdqu w(CTX), RK1;
-	pushq %rbp;
+	pushq %r13;
 	pushq %rbx;
 	pushq %rcx;
@@ -282,7 +282,7 @@ __twofish_enc_blk8:
 	popq %rcx;
 	popq %rbx;
-	popq %rbp;
+	popq %r13;
 	outunpack_blocks(RC1, RD1, RA1, RB1, RK1, RX0, RY0, RK2);
 	outunpack_blocks(RC2, RD2, RA2, RB2, RK1, RX0, RY0, RK2);
@@ -301,7 +301,7 @@ __twofish_dec_blk8:
 	vmovdqu (w+4*4)(CTX), RK1;
-	pushq %rbp;
+	pushq %r13;
 	pushq %rbx;
 	inpack_blocks(RC1, RD1, RA1, RB1, RK1, RX0, RY0, RK2);
@@ -322,7 +322,7 @@ __twofish_dec_blk8:
 	vmovdqu (w)(CTX), RK1;
 	popq %rbx;
-	popq %rbp;
+	popq %r13;
 	outunpack_blocks(RA1, RB1, RC1, RD1, RK1, RX0, RY0, RK2);
 	outunpack_blocks(RA2, RB2, RC2, RD2, RK1, RX0, RY0, RK2);

Powered by blists - more mailing lists