diff options
-rw-r--r-- | arch/powerpc/include/asm/uaccess.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/arch/powerpc/include/asm/uaccess.h b/arch/powerpc/include/asm/uaccess.h index 4db49590acf5..9485b43a7c00 100644 --- a/arch/powerpc/include/asm/uaccess.h +++ b/arch/powerpc/include/asm/uaccess.h | |||
@@ -178,7 +178,7 @@ do { \ | |||
178 | long __pu_err; \ | 178 | long __pu_err; \ |
179 | __typeof__(*(ptr)) __user *__pu_addr = (ptr); \ | 179 | __typeof__(*(ptr)) __user *__pu_addr = (ptr); \ |
180 | if (!is_kernel_addr((unsigned long)__pu_addr)) \ | 180 | if (!is_kernel_addr((unsigned long)__pu_addr)) \ |
181 | might_sleep(); \ | 181 | might_fault(); \ |
182 | __chk_user_ptr(ptr); \ | 182 | __chk_user_ptr(ptr); \ |
183 | __put_user_size((x), __pu_addr, (size), __pu_err); \ | 183 | __put_user_size((x), __pu_addr, (size), __pu_err); \ |
184 | __pu_err; \ | 184 | __pu_err; \ |
@@ -188,7 +188,7 @@ do { \ | |||
188 | ({ \ | 188 | ({ \ |
189 | long __pu_err = -EFAULT; \ | 189 | long __pu_err = -EFAULT; \ |
190 | __typeof__(*(ptr)) __user *__pu_addr = (ptr); \ | 190 | __typeof__(*(ptr)) __user *__pu_addr = (ptr); \ |
191 | might_sleep(); \ | 191 | might_fault(); \ |
192 | if (access_ok(VERIFY_WRITE, __pu_addr, size)) \ | 192 | if (access_ok(VERIFY_WRITE, __pu_addr, size)) \ |
193 | __put_user_size((x), __pu_addr, (size), __pu_err); \ | 193 | __put_user_size((x), __pu_addr, (size), __pu_err); \ |
194 | __pu_err; \ | 194 | __pu_err; \ |
@@ -268,7 +268,7 @@ do { \ | |||
268 | const __typeof__(*(ptr)) __user *__gu_addr = (ptr); \ | 268 | const __typeof__(*(ptr)) __user *__gu_addr = (ptr); \ |
269 | __chk_user_ptr(ptr); \ | 269 | __chk_user_ptr(ptr); \ |
270 | if (!is_kernel_addr((unsigned long)__gu_addr)) \ | 270 | if (!is_kernel_addr((unsigned long)__gu_addr)) \ |
271 | might_sleep(); \ | 271 | might_fault(); \ |
272 | __get_user_size(__gu_val, __gu_addr, (size), __gu_err); \ | 272 | __get_user_size(__gu_val, __gu_addr, (size), __gu_err); \ |
273 | (x) = (__typeof__(*(ptr)))__gu_val; \ | 273 | (x) = (__typeof__(*(ptr)))__gu_val; \ |
274 | __gu_err; \ | 274 | __gu_err; \ |
@@ -282,7 +282,7 @@ do { \ | |||
282 | const __typeof__(*(ptr)) __user *__gu_addr = (ptr); \ | 282 | const __typeof__(*(ptr)) __user *__gu_addr = (ptr); \ |
283 | __chk_user_ptr(ptr); \ | 283 | __chk_user_ptr(ptr); \ |
284 | if (!is_kernel_addr((unsigned long)__gu_addr)) \ | 284 | if (!is_kernel_addr((unsigned long)__gu_addr)) \ |
285 | might_sleep(); \ | 285 | might_fault(); \ |
286 | __get_user_size(__gu_val, __gu_addr, (size), __gu_err); \ | 286 | __get_user_size(__gu_val, __gu_addr, (size), __gu_err); \ |
287 | (x) = (__typeof__(*(ptr)))__gu_val; \ | 287 | (x) = (__typeof__(*(ptr)))__gu_val; \ |
288 | __gu_err; \ | 288 | __gu_err; \ |
@@ -294,7 +294,7 @@ do { \ | |||
294 | long __gu_err = -EFAULT; \ | 294 | long __gu_err = -EFAULT; \ |
295 | unsigned long __gu_val = 0; \ | 295 | unsigned long __gu_val = 0; \ |
296 | const __typeof__(*(ptr)) __user *__gu_addr = (ptr); \ | 296 | const __typeof__(*(ptr)) __user *__gu_addr = (ptr); \ |
297 | might_sleep(); \ | 297 | might_fault(); \ |
298 | if (access_ok(VERIFY_READ, __gu_addr, (size))) \ | 298 | if (access_ok(VERIFY_READ, __gu_addr, (size))) \ |
299 | __get_user_size(__gu_val, __gu_addr, (size), __gu_err); \ | 299 | __get_user_size(__gu_val, __gu_addr, (size), __gu_err); \ |
300 | (x) = (__typeof__(*(ptr)))__gu_val; \ | 300 | (x) = (__typeof__(*(ptr)))__gu_val; \ |
@@ -419,14 +419,14 @@ static inline unsigned long __copy_to_user_inatomic(void __user *to, | |||
419 | static inline unsigned long __copy_from_user(void *to, | 419 | static inline unsigned long __copy_from_user(void *to, |
420 | const void __user *from, unsigned long size) | 420 | const void __user *from, unsigned long size) |
421 | { | 421 | { |
422 | might_sleep(); | 422 | might_fault(); |
423 | return __copy_from_user_inatomic(to, from, size); | 423 | return __copy_from_user_inatomic(to, from, size); |
424 | } | 424 | } |
425 | 425 | ||
426 | static inline unsigned long __copy_to_user(void __user *to, | 426 | static inline unsigned long __copy_to_user(void __user *to, |
427 | const void *from, unsigned long size) | 427 | const void *from, unsigned long size) |
428 | { | 428 | { |
429 | might_sleep(); | 429 | might_fault(); |
430 | return __copy_to_user_inatomic(to, from, size); | 430 | return __copy_to_user_inatomic(to, from, size); |
431 | } | 431 | } |
432 | 432 | ||
@@ -434,7 +434,7 @@ extern unsigned long __clear_user(void __user *addr, unsigned long size); | |||
434 | 434 | ||
435 | static inline unsigned long clear_user(void __user *addr, unsigned long size) | 435 | static inline unsigned long clear_user(void __user *addr, unsigned long size) |
436 | { | 436 | { |
437 | might_sleep(); | 437 | might_fault(); |
438 | if (likely(access_ok(VERIFY_WRITE, addr, size))) | 438 | if (likely(access_ok(VERIFY_WRITE, addr, size))) |
439 | return __clear_user(addr, size); | 439 | return __clear_user(addr, size); |
440 | if ((unsigned long)addr < TASK_SIZE) { | 440 | if ((unsigned long)addr < TASK_SIZE) { |