aboutsummaryrefslogtreecommitdiffstats
path: root/arch/tile/include/asm/uaccess.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/tile/include/asm/uaccess.h')
-rw-r--r--arch/tile/include/asm/uaccess.h22
1 files changed, 12 insertions, 10 deletions
diff --git a/arch/tile/include/asm/uaccess.h b/arch/tile/include/asm/uaccess.h
index f3058afd5a88..ed17a80ec0ed 100644
--- a/arch/tile/include/asm/uaccess.h
+++ b/arch/tile/include/asm/uaccess.h
@@ -89,8 +89,10 @@ int __range_ok(unsigned long addr, unsigned long size);
89 * checks that the pointer is in the user space range - after calling 89 * checks that the pointer is in the user space range - after calling
90 * this function, memory access functions may still return -EFAULT. 90 * this function, memory access functions may still return -EFAULT.
91 */ 91 */
92#define access_ok(type, addr, size) \ 92#define access_ok(type, addr, size) ({ \
93 (likely(__range_ok((unsigned long)addr, size) == 0)) 93 __chk_user_ptr(addr); \
94 likely(__range_ok((unsigned long)(addr), (size)) == 0); \
95})
94 96
95/* 97/*
96 * The exception table consists of pairs of addresses: the first is the 98 * The exception table consists of pairs of addresses: the first is the
@@ -134,14 +136,14 @@ struct __get_user {
134 * such extended assembler routines, though we will have to use a 136 * such extended assembler routines, though we will have to use a
135 * different return code in that case (1, 2, or 4, rather than -EFAULT). 137 * different return code in that case (1, 2, or 4, rather than -EFAULT).
136 */ 138 */
137extern struct __get_user __get_user_1(const void *); 139extern struct __get_user __get_user_1(const void __user *);
138extern struct __get_user __get_user_2(const void *); 140extern struct __get_user __get_user_2(const void __user *);
139extern struct __get_user __get_user_4(const void *); 141extern struct __get_user __get_user_4(const void __user *);
140extern struct __get_user __get_user_8(const void *); 142extern struct __get_user __get_user_8(const void __user *);
141extern int __put_user_1(long, void *); 143extern int __put_user_1(long, void __user *);
142extern int __put_user_2(long, void *); 144extern int __put_user_2(long, void __user *);
143extern int __put_user_4(long, void *); 145extern int __put_user_4(long, void __user *);
144extern int __put_user_8(long long, void *); 146extern int __put_user_8(long long, void __user *);
145 147
146/* Unimplemented routines to cause linker failures */ 148/* Unimplemented routines to cause linker failures */
147extern struct __get_user __get_user_bad(void); 149extern struct __get_user __get_user_bad(void);