score: switch to RAW_COPY_USER
authorAl Viro <viro@zeniv.linux.org.uk>
Wed, 22 Mar 2017 17:26:57 +0000 (13:26 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Tue, 28 Mar 2017 22:23:58 +0000 (18:23 -0400)
... and kill copy_in_user() - it's not a biarch architecture, to start with

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
arch/score/Kconfig
arch/score/include/asm/uaccess.h

index 507d6318138941aa5dec6cc767e992ca598e009f..4d241cfedc3bddf663a5060c3d383c4208bcf8fd 100644 (file)
@@ -15,6 +15,7 @@ config SCORE
        select MODULES_USE_ELF_REL
        select CLONE_BACKWARDS
        select CPU_NO_EFFICIENT_FFS
+       select ARCH_HAS_RAW_COPY_USER
 
 choice
        prompt "System type"
index 79125fa6ed43250497d88f1439c729cf5715c6c9..916e5dbf0bfdbb09bc0b2adcb9aef1e33d997ad5 100644 (file)
@@ -295,61 +295,19 @@ extern void __put_user_unknown(void);
 extern int __copy_tofrom_user(void *to, const void *from, unsigned long len);
 
 static inline unsigned long
-copy_from_user(void *to, const void *from, unsigned long len)
+raw_copy_from_user(void *to, const void __user *from, unsigned long len)
 {
-       unsigned long res = len;
-
-       if (likely(access_ok(VERIFY_READ, from, len)))
-               res = __copy_tofrom_user(to, from, len);
-
-       if (unlikely(res))
-               memset(to + (len - res), 0, res);
-
-       return res;
+       return __copy_tofrom_user(to, (__force const void *)from, len);
 }
 
 static inline unsigned long
-copy_to_user(void *to, const void *from, unsigned long len)
+raw_copy_to_user(void __user *to, const void *from, unsigned long len)
 {
-       if (likely(access_ok(VERIFY_WRITE, to, len)))
-               len = __copy_tofrom_user(to, from, len);
-
-       return len;
+       return __copy_tofrom_user((__force void *)to, from, len);
 }
 
-static inline unsigned long
-__copy_from_user(void *to, const void *from, unsigned long len)
-{
-       unsigned long left = __copy_tofrom_user(to, from, len);
-       if (unlikely(left))
-               memset(to + (len - left), 0, left);
-       return left;
-}
-
-#define __copy_to_user(to, from, len)          \
-               __copy_tofrom_user((to), (from), (len))
-
-static inline unsigned long
-__copy_to_user_inatomic(void *to, const void *from, unsigned long len)
-{
-       return __copy_to_user(to, from, len);
-}
-
-static inline unsigned long
-__copy_from_user_inatomic(void *to, const void *from, unsigned long len)
-{
-       return __copy_tofrom_user(to, from, len);
-}
-
-#define __copy_in_user(to, from, len)  __copy_tofrom_user(to, from, len)
-
-static inline unsigned long
-copy_in_user(void *to, const void *from, unsigned long len)
-{
-       if (access_ok(VERIFY_READ, from, len) &&
-                     access_ok(VERIFY_WRITE, to, len))
-               return __copy_tofrom_user(to, from, len);
-}
+#define INLINE_COPY_FROM_USER
+#define INLINE_COPY_TO_USER
 
 /*
  * __clear_user: - Zero a block of memory in user space, with less checking.