summary refs log tree commit diff
diff options
context:
space:
mode:
authorGlauber Costa <gcosta@redhat.com>2008-06-25 13:00:48 -0300
committerIngo Molnar <mingo@elte.hu>2008-07-09 09:14:26 +0200
commitec840956d269e2beefe3a1c0fd7c1c70a199087f (patch)
tree70e6b2af4afef5c4bc6b9e6a3682de367f4e3f26
parent64a978c1e3b2c0e2b663caf54719319919c5c17f (diff)
downloadlinux-ec840956d269e2beefe3a1c0fd7c1c70a199087f.tar.gz
x86: turn __put_user_check directly into put_user.
We also check user pointer in x86_64 put_user, the way i386 does.

In a separate patch for bisecting purposes.

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--include/asm-x86/uaccess_64.h8
1 files changed, 3 insertions, 5 deletions
diff --git a/include/asm-x86/uaccess_64.h b/include/asm-x86/uaccess_64.h
index 42a9769687e9..9139854d37b0 100644
--- a/include/asm-x86/uaccess_64.h
+++ b/include/asm-x86/uaccess_64.h
@@ -23,9 +23,6 @@ extern void __put_user_bad(void);
 		     :"c" (ptr),"a" (x)					\
 		     :"ebx")
 
-#define put_user(x, ptr)						\
-	__put_user_check((__typeof__(*(ptr)))(x), (ptr), sizeof(*(ptr)))
-
 #define __get_user(x, ptr)						\
 	__get_user_nocheck((x), (ptr), sizeof(*(ptr)))
 #define __put_user(x, ptr)						\
@@ -34,11 +31,12 @@ extern void __put_user_bad(void);
 #define __get_user_unaligned __get_user
 #define __put_user_unaligned __put_user
 
-#define __put_user_check(x, ptr, size)				\
+#define put_user(x, ptr)					\
 ({								\
 	int __pu_err;						\
 	typeof(*(ptr)) __user *__pu_addr = (ptr);		\
-	switch (size) {						\
+	__chk_user_ptr(ptr);					\
+	switch (sizeof(*(ptr))) {				\
 	case 1:							\
 		__put_user_x(1, __pu_err, x, __pu_addr);	\
 		break;						\