aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-x86/uaccess_64.h
diff options
context:
space:
mode:
authorGlauber Costa <gcosta@redhat.com>2008-06-25 12:00:48 -0400
committerIngo Molnar <mingo@elte.hu>2008-07-09 03:14:26 -0400
commitec840956d269e2beefe3a1c0fd7c1c70a199087f (patch)
tree70e6b2af4afef5c4bc6b9e6a3682de367f4e3f26 /include/asm-x86/uaccess_64.h
parent64a978c1e3b2c0e2b663caf54719319919c5c17f (diff)
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>
Diffstat (limited to 'include/asm-x86/uaccess_64.h')
-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);
23 :"c" (ptr),"a" (x) \ 23 :"c" (ptr),"a" (x) \
24 :"ebx") 24 :"ebx")
25 25
26#define put_user(x, ptr) \
27 __put_user_check((__typeof__(*(ptr)))(x), (ptr), sizeof(*(ptr)))
28
29#define __get_user(x, ptr) \ 26#define __get_user(x, ptr) \
30 __get_user_nocheck((x), (ptr), sizeof(*(ptr))) 27 __get_user_nocheck((x), (ptr), sizeof(*(ptr)))
31#define __put_user(x, ptr) \ 28#define __put_user(x, ptr) \
@@ -34,11 +31,12 @@ extern void __put_user_bad(void);
34#define __get_user_unaligned __get_user 31#define __get_user_unaligned __get_user
35#define __put_user_unaligned __put_user 32#define __put_user_unaligned __put_user
36 33
37#define __put_user_check(x, ptr, size) \ 34#define put_user(x, ptr) \
38({ \ 35({ \
39 int __pu_err; \ 36 int __pu_err; \
40 typeof(*(ptr)) __user *__pu_addr = (ptr); \ 37 typeof(*(ptr)) __user *__pu_addr = (ptr); \
41 switch (size) { \ 38 __chk_user_ptr(ptr); \
39 switch (sizeof(*(ptr))) { \
42 case 1: \ 40 case 1: \
43 __put_user_x(1, __pu_err, x, __pu_addr); \ 41 __put_user_x(1, __pu_err, x, __pu_addr); \
44 break; \ 42 break; \