@@ -967,60 +967,6 @@ __clear_user(void __user *addr, __kernel_size_t size)
967
967
__cl_size; \
968
968
})
969
969
970
- extern long __strncpy_from_kernel_nocheck_asm (char * __to , const char __user * __from , long __len );
971
- extern long __strncpy_from_user_nocheck_asm (char * __to , const char __user * __from , long __len );
972
-
973
- /*
974
- * __strncpy_from_user: - Copy a NUL terminated string from userspace, with less checking.
975
- * @dst: Destination address, in kernel space. This buffer must be at
976
- * least @count bytes long.
977
- * @src: Source address, in user space.
978
- * @count: Maximum number of bytes to copy, including the trailing NUL.
979
- *
980
- * Copies a NUL-terminated string from userspace to kernel space.
981
- * Caller must check the specified block with access_ok() before calling
982
- * this function.
983
- *
984
- * On success, returns the length of the string (not including the trailing
985
- * NUL).
986
- *
987
- * If access to userspace fails, returns -EFAULT (some data may have been
988
- * copied).
989
- *
990
- * If @count is smaller than the length of the string, copies @count bytes
991
- * and returns @count.
992
- */
993
- static inline long
994
- __strncpy_from_user (char * __to , const char __user * __from , long __len )
995
- {
996
- long res ;
997
-
998
- if (eva_kernel_access ()) {
999
- __asm__ __volatile__(
1000
- "move\t$4, %1\n\t"
1001
- "move\t$5, %2\n\t"
1002
- "move\t$6, %3\n\t"
1003
- __MODULE_JAL (__strncpy_from_kernel_nocheck_asm )
1004
- "move\t%0, $2"
1005
- : "=r" (res )
1006
- : "r" (__to ), "r" (__from ), "r" (__len )
1007
- : "$2" , "$3" , "$4" , "$5" , "$6" , __UA_t0 , "$31" , "memory" );
1008
- } else {
1009
- might_fault ();
1010
- __asm__ __volatile__(
1011
- "move\t$4, %1\n\t"
1012
- "move\t$5, %2\n\t"
1013
- "move\t$6, %3\n\t"
1014
- __MODULE_JAL (__strncpy_from_user_nocheck_asm )
1015
- "move\t%0, $2"
1016
- : "=r" (res )
1017
- : "r" (__to ), "r" (__from ), "r" (__len )
1018
- : "$2" , "$3" , "$4" , "$5" , "$6" , __UA_t0 , "$31" , "memory" );
1019
- }
1020
-
1021
- return res ;
1022
- }
1023
-
1024
970
extern long __strncpy_from_kernel_asm (char * __to , const char __user * __from , long __len );
1025
971
extern long __strncpy_from_user_asm (char * __to , const char __user * __from , long __len );
1026
972
0 commit comments