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:16 -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 09/39] adapt x86_64 getuser functions

instead of doing a sub after the addition, use the
offset directly at the memory operand of the mov instructions.
This is the way i386 do.

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

diff --git a/arch/x86/lib/getuser_64.S b/arch/x86/lib/getuser_64.S
index 2b003d3..df37d3a 100644
--- a/arch/x86/lib/getuser_64.S
+++ b/arch/x86/lib/getuser_64.S
@@ -47,49 +47,40 @@ ENDPROC(__get_user_1)
 
 ENTRY(__get_user_2)
 	CFI_STARTPROC
-	GET_THREAD_INFO(%rdx)
 	addq $1,%rax
-	jc 20f
+	jc bad_get_user
+	GET_THREAD_INFO(%rdx)
 	cmpq threadinfo_addr_limit(%rdx),%rax
-	jae 20f
-	decq   %rax
-2:	movzwl (%rax),%edx
+	jae bad_get_user
+2:	movzwl -1(%rax),%edx
 	xorl %eax,%eax
 	ret
-20:	decq    %rax
-	jmp	bad_get_user
 	CFI_ENDPROC
 ENDPROC(__get_user_2)
 
 ENTRY(__get_user_4)
 	CFI_STARTPROC
-	GET_THREAD_INFO(%rdx)
 	addq $3,%rax
-	jc 30f
+	jc bad_get_user
+	GET_THREAD_INFO(%rdx)
 	cmpq threadinfo_addr_limit(%rdx),%rax
-	jae 30f
-	subq $3,%rax
-3:	movl (%rax),%edx
+	jae bad_get_user
+3:	movl -3(%rax),%edx
 	xorl %eax,%eax
 	ret
-30:	subq $3,%rax
-	jmp bad_get_user
 	CFI_ENDPROC
 ENDPROC(__get_user_4)
 
 ENTRY(__get_user_8)
 	CFI_STARTPROC
-	GET_THREAD_INFO(%rdx)
 	addq $7,%rax
-	jc 40f
+	jc bad_get_user
+	GET_THREAD_INFO(%rdx)
 	cmpq threadinfo_addr_limit(%rdx),%rax
-	jae	40f
-	subq	$7,%rax
-4:	movq (%rax),%rdx
+	jae	bad_get_user
+4:	movq -7(%rax),%rdx
 	xorl %eax,%eax
 	ret
-40:	subq $7,%rax
-	jmp bad_get_user
 	CFI_ENDPROC
 ENDPROC(__get_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