Loading arch/nios2/Kconfig +2 −0 Original line number Diff line number Diff line Loading @@ -6,6 +6,8 @@ config NIOS2 select GENERIC_CPU_DEVICES select GENERIC_IRQ_PROBE select GENERIC_IRQ_SHOW select GENERIC_STRNCPY_FROM_USER select GENERIC_STRNLEN_USER select HAVE_ARCH_TRACEHOOK select HAVE_ARCH_KGDB select IRQ_DOMAIN Loading arch/nios2/include/asm/uaccess.h +5 −2 Original line number Diff line number Diff line Loading @@ -42,6 +42,8 @@ # define __EX_TABLE_SECTION ".section __ex_table,\"a\"\n" #define user_addr_max() (uaccess_kernel() ? ~0UL : TASK_SIZE) /* * Zero Userspace */ Loading Loading @@ -82,7 +84,8 @@ raw_copy_to_user(void __user *to, const void *from, unsigned long n); extern long strncpy_from_user(char *__to, const char __user *__from, long __len); extern long strnlen_user(const char __user *s, long n); extern __must_check long strlen_user(const char __user *str); extern __must_check long strnlen_user(const char __user *s, long n); /* Optimized macros */ #define __get_user_asm(val, insn, addr, err) \ Loading arch/nios2/mm/uaccess.c +0 −33 Original line number Diff line number Diff line Loading @@ -128,36 +128,3 @@ asm( ".word 12b,13b\n" ".previous\n"); EXPORT_SYMBOL(raw_copy_to_user); long strncpy_from_user(char *__to, const char __user *__from, long __len) { int l = strnlen_user(__from, __len); int is_zt = 1; if (l > __len) { is_zt = 0; l = __len; } if (l == 0 || copy_from_user(__to, __from, l)) return -EFAULT; if (is_zt) l--; return l; } long strnlen_user(const char __user *s, long n) { long i; for (i = 0; i < n; i++) { char c; if (get_user(c, s + i) == -EFAULT) return 0; if (c == 0) return i + 1; } return n + 1; } Loading
arch/nios2/Kconfig +2 −0 Original line number Diff line number Diff line Loading @@ -6,6 +6,8 @@ config NIOS2 select GENERIC_CPU_DEVICES select GENERIC_IRQ_PROBE select GENERIC_IRQ_SHOW select GENERIC_STRNCPY_FROM_USER select GENERIC_STRNLEN_USER select HAVE_ARCH_TRACEHOOK select HAVE_ARCH_KGDB select IRQ_DOMAIN Loading
arch/nios2/include/asm/uaccess.h +5 −2 Original line number Diff line number Diff line Loading @@ -42,6 +42,8 @@ # define __EX_TABLE_SECTION ".section __ex_table,\"a\"\n" #define user_addr_max() (uaccess_kernel() ? ~0UL : TASK_SIZE) /* * Zero Userspace */ Loading Loading @@ -82,7 +84,8 @@ raw_copy_to_user(void __user *to, const void *from, unsigned long n); extern long strncpy_from_user(char *__to, const char __user *__from, long __len); extern long strnlen_user(const char __user *s, long n); extern __must_check long strlen_user(const char __user *str); extern __must_check long strnlen_user(const char __user *s, long n); /* Optimized macros */ #define __get_user_asm(val, insn, addr, err) \ Loading
arch/nios2/mm/uaccess.c +0 −33 Original line number Diff line number Diff line Loading @@ -128,36 +128,3 @@ asm( ".word 12b,13b\n" ".previous\n"); EXPORT_SYMBOL(raw_copy_to_user); long strncpy_from_user(char *__to, const char __user *__from, long __len) { int l = strnlen_user(__from, __len); int is_zt = 1; if (l > __len) { is_zt = 0; l = __len; } if (l == 0 || copy_from_user(__to, __from, l)) return -EFAULT; if (is_zt) l--; return l; } long strnlen_user(const char __user *s, long n) { long i; for (i = 0; i < n; i++) { char c; if (get_user(c, s + i) == -EFAULT) return 0; if (c == 0) return i + 1; } return n + 1; }