diff options
-rw-r--r-- | arch/x86/lib/usercopy_32.c | 1 | ||||
-rw-r--r-- | include/asm-x86/uaccess.h | 2 | ||||
-rw-r--r-- | include/linux/uaccess.h | 2 |
3 files changed, 2 insertions, 3 deletions
diff --git a/arch/x86/lib/usercopy_32.c b/arch/x86/lib/usercopy_32.c index 7393152a252e..fab5faba1d3e 100644 --- a/arch/x86/lib/usercopy_32.c +++ b/arch/x86/lib/usercopy_32.c | |||
@@ -148,6 +148,7 @@ do { \ | |||
148 | unsigned long | 148 | unsigned long |
149 | clear_user(void __user *to, unsigned long n) | 149 | clear_user(void __user *to, unsigned long n) |
150 | { | 150 | { |
151 | might_fault(); | ||
151 | if (access_ok(VERIFY_WRITE, to, n)) | 152 | if (access_ok(VERIFY_WRITE, to, n)) |
152 | __do_clear_user(to, n); | 153 | __do_clear_user(to, n); |
153 | return n; | 154 | return n; |
diff --git a/include/asm-x86/uaccess.h b/include/asm-x86/uaccess.h index 39f8420c75d9..dc8edb5c4659 100644 --- a/include/asm-x86/uaccess.h +++ b/include/asm-x86/uaccess.h | |||
@@ -267,7 +267,6 @@ extern void __put_user_8(void); | |||
267 | #define __put_user_size(x, ptr, size, retval, errret) \ | 267 | #define __put_user_size(x, ptr, size, retval, errret) \ |
268 | do { \ | 268 | do { \ |
269 | retval = 0; \ | 269 | retval = 0; \ |
270 | might_fault(); \ | ||
271 | __chk_user_ptr(ptr); \ | 270 | __chk_user_ptr(ptr); \ |
272 | switch (size) { \ | 271 | switch (size) { \ |
273 | case 1: \ | 272 | case 1: \ |
@@ -320,7 +319,6 @@ do { \ | |||
320 | #define __get_user_size(x, ptr, size, retval, errret) \ | 319 | #define __get_user_size(x, ptr, size, retval, errret) \ |
321 | do { \ | 320 | do { \ |
322 | retval = 0; \ | 321 | retval = 0; \ |
323 | might_fault(); \ | ||
324 | __chk_user_ptr(ptr); \ | 322 | __chk_user_ptr(ptr); \ |
325 | switch (size) { \ | 323 | switch (size) { \ |
326 | case 1: \ | 324 | case 1: \ |
diff --git a/include/linux/uaccess.h b/include/linux/uaccess.h index fec6decfb983..2062293e57e6 100644 --- a/include/linux/uaccess.h +++ b/include/linux/uaccess.h | |||
@@ -78,7 +78,7 @@ static inline unsigned long __copy_from_user_nocache(void *to, | |||
78 | \ | 78 | \ |
79 | set_fs(KERNEL_DS); \ | 79 | set_fs(KERNEL_DS); \ |
80 | pagefault_disable(); \ | 80 | pagefault_disable(); \ |
81 | ret = __get_user(retval, (__force typeof(retval) __user *)(addr)); \ | 81 | ret = __copy_from_user_inatomic((__force typeof(retval) __user *)(addr), &(retval), sizeof(retval)); \ |
82 | pagefault_enable(); \ | 82 | pagefault_enable(); \ |
83 | set_fs(old_fs); \ | 83 | set_fs(old_fs); \ |
84 | ret; \ | 84 | ret; \ |