lists.openwall.net   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  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 27 Jun 2008 18:34:26 -0300
From:	Glauber Costa <gcosta@...hat.com>
To:	linux-kernel@...r.kernel.org
Cc:	tglx@...utronix.de, mingo@...e.hu, x86@...nel.org
Subject: [PATCH 19/39] change testing logic in putuser_64.S

Instead of operating over a register we need to put back
into normal state afterwards (the memory position), just
sub from rbx, which is trashed anyway. We can save a few instructions.

Also, this is the i386 way.

Signed-off-by: Glauber Costa <gcosta@...hat.com>
---
 arch/x86/lib/putuser_64.S |   33 ++++++++++++---------------------
 1 files changed, 12 insertions(+), 21 deletions(-)

diff --git a/arch/x86/lib/putuser_64.S b/arch/x86/lib/putuser_64.S
index ce5fcd5..a96bd8a 100644
--- a/arch/x86/lib/putuser_64.S
+++ b/arch/x86/lib/putuser_64.S
@@ -46,48 +46,39 @@ ENDPROC(__put_user_1)
 ENTRY(__put_user_2)
 	CFI_STARTPROC
 	GET_THREAD_INFO(%rbx)
-	addq $1,%rcx
-	jc 20f
-	cmpq TI_addr_limit(%rbx),%rcx
-	jae 20f
-	decq %rcx
+	mov TI_addr_limit(%rbx),%rbx
+	sub  $1, %rbx
+	cmpq %rbx ,%rcx
+	jae  bad_put_user
 2:	movw %ax,(%rcx)
 	xorl %eax,%eax
 	ret
-20:	decq %rcx
-	jmp bad_put_user
 	CFI_ENDPROC
 ENDPROC(__put_user_2)
 
 ENTRY(__put_user_4)
 	CFI_STARTPROC
 	GET_THREAD_INFO(%rbx)
-	addq $3,%rcx
-	jc 30f
-	cmpq TI_addr_limit(%rbx),%rcx
-	jae 30f
-	subq $3,%rcx
+	mov TI_addr_limit(%rbx),%rbx
+	sub  $3, %rbx
+	cmp  %rbx, %rcx
+	jae bad_put_user
 3:	movl %eax,(%rcx)
 	xorl %eax,%eax
 	ret
-30:	subq $3,%rcx
-	jmp bad_put_user
 	CFI_ENDPROC
 ENDPROC(__put_user_4)
 
 ENTRY(__put_user_8)
 	CFI_STARTPROC
 	GET_THREAD_INFO(%rbx)
-	addq $7,%rcx
-	jc 40f
-	cmpq TI_addr_limit(%rbx),%rcx
-	jae 40f
-	subq $7,%rcx
+	mov TI_addr_limit(%rbx),%rbx
+	sub  $7, %rbx
+	cmp  %rbx, %rcx
+	jae bad_put_user
 4:	movq %rax,(%rcx)
 	xorl %eax,%eax
 	ret
-40:	subq $7,%rcx
-	jmp bad_put_user
 	CFI_ENDPROC
 ENDPROC(__put_user_8)
 
-- 
1.5.5.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ