--- zzzz-none-000/linux-3.10.107/include/asm-generic/uaccess.h 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/include/asm-generic/uaccess.h 2021-02-04 17:41:59.000000000 +0000 @@ -3,7 +3,7 @@ /* * User space memory access functions, these should work - * on a ny machine that has kernel and user data in the same + * on any machine that has kernel and user data in the same * address space, e.g. all NOMMU machines. */ #include @@ -163,9 +163,10 @@ #define put_user(x, ptr) \ ({ \ - might_sleep(); \ - access_ok(VERIFY_WRITE, ptr, sizeof(*ptr)) ? \ - __put_user(x, ptr) : \ + void *__p = (ptr); \ + might_fault(); \ + access_ok(VERIFY_WRITE, __p, sizeof(*ptr)) ? \ + __put_user((x), ((__typeof__(*(ptr)) *)__p)) : \ -EFAULT; \ }) @@ -225,9 +226,10 @@ #define get_user(x, ptr) \ ({ \ - might_sleep(); \ - access_ok(VERIFY_READ, ptr, sizeof(*ptr)) ? \ - __get_user(x, ptr) : \ + const void *__p = (ptr); \ + might_fault(); \ + access_ok(VERIFY_READ, __p, sizeof(*ptr)) ? \ + __get_user((x), (__typeof__(*(ptr)) *)__p) : \ ((x) = (__typeof__(*(ptr)))0,-EFAULT); \ }) @@ -260,7 +262,7 @@ const void __user * from, unsigned long n) { unsigned long res = n; - might_sleep(); + might_fault(); if (likely(access_ok(VERIFY_READ, from, n))) res = __copy_from_user(to, from, n); if (unlikely(res)) @@ -271,7 +273,7 @@ static inline long copy_to_user(void __user *to, const void *from, unsigned long n) { - might_sleep(); + might_fault(); if (access_ok(VERIFY_WRITE, to, n)) return __copy_to_user(to, from, n); else @@ -342,7 +344,7 @@ static inline __must_check unsigned long clear_user(void __user *to, unsigned long n) { - might_sleep(); + might_fault(); if (!access_ok(VERIFY_WRITE, to, n)) return n;