diff options
Diffstat (limited to 'include/asm-powerpc/uaccess.h')
-rw-r--r-- | include/asm-powerpc/uaccess.h | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/include/asm-powerpc/uaccess.h b/include/asm-powerpc/uaccess.h index 3872e924cdd6..d83fc29c2bbf 100644 --- a/include/asm-powerpc/uaccess.h +++ b/include/asm-powerpc/uaccess.h | |||
@@ -7,6 +7,7 @@ | |||
7 | #include <linux/sched.h> | 7 | #include <linux/sched.h> |
8 | #include <linux/errno.h> | 8 | #include <linux/errno.h> |
9 | #include <asm/processor.h> | 9 | #include <asm/processor.h> |
10 | #include <asm/page.h> | ||
10 | 11 | ||
11 | #define VERIFY_READ 0 | 12 | #define VERIFY_READ 0 |
12 | #define VERIFY_WRITE 1 | 13 | #define VERIFY_WRITE 1 |
@@ -179,9 +180,11 @@ do { \ | |||
179 | #define __put_user_nocheck(x, ptr, size) \ | 180 | #define __put_user_nocheck(x, ptr, size) \ |
180 | ({ \ | 181 | ({ \ |
181 | long __pu_err; \ | 182 | long __pu_err; \ |
182 | might_sleep(); \ | 183 | __typeof__(*(ptr)) __user *__pu_addr = (ptr); \ |
184 | if (!is_kernel_addr((unsigned long)__pu_addr)) \ | ||
185 | might_sleep(); \ | ||
183 | __chk_user_ptr(ptr); \ | 186 | __chk_user_ptr(ptr); \ |
184 | __put_user_size((x), (ptr), (size), __pu_err); \ | 187 | __put_user_size((x), __pu_addr, (size), __pu_err); \ |
185 | __pu_err; \ | 188 | __pu_err; \ |
186 | }) | 189 | }) |
187 | 190 | ||
@@ -258,9 +261,11 @@ do { \ | |||
258 | ({ \ | 261 | ({ \ |
259 | long __gu_err; \ | 262 | long __gu_err; \ |
260 | unsigned long __gu_val; \ | 263 | unsigned long __gu_val; \ |
264 | const __typeof__(*(ptr)) __user *__gu_addr = (ptr); \ | ||
261 | __chk_user_ptr(ptr); \ | 265 | __chk_user_ptr(ptr); \ |
262 | might_sleep(); \ | 266 | if (!is_kernel_addr((unsigned long)__gu_addr)) \ |
263 | __get_user_size(__gu_val, (ptr), (size), __gu_err); \ | 267 | might_sleep(); \ |
268 | __get_user_size(__gu_val, __gu_addr, (size), __gu_err); \ | ||
264 | (x) = (__typeof__(*(ptr)))__gu_val; \ | 269 | (x) = (__typeof__(*(ptr)))__gu_val; \ |
265 | __gu_err; \ | 270 | __gu_err; \ |
266 | }) | 271 | }) |
@@ -270,9 +275,11 @@ do { \ | |||
270 | ({ \ | 275 | ({ \ |
271 | long __gu_err; \ | 276 | long __gu_err; \ |
272 | long long __gu_val; \ | 277 | long long __gu_val; \ |
278 | const __typeof__(*(ptr)) __user *__gu_addr = (ptr); \ | ||
273 | __chk_user_ptr(ptr); \ | 279 | __chk_user_ptr(ptr); \ |
274 | might_sleep(); \ | 280 | if (!is_kernel_addr((unsigned long)__gu_addr)) \ |
275 | __get_user_size(__gu_val, (ptr), (size), __gu_err); \ | 281 | might_sleep(); \ |
282 | __get_user_size(__gu_val, __gu_addr, (size), __gu_err); \ | ||
276 | (x) = (__typeof__(*(ptr)))__gu_val; \ | 283 | (x) = (__typeof__(*(ptr)))__gu_val; \ |
277 | __gu_err; \ | 284 | __gu_err; \ |
278 | }) | 285 | }) |