From ff06dffbc8abfc60d6a0332f058f1d1bb01abb31 Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Tue, 22 May 2012 17:53:19 -0700 Subject: sparc: Add full proper error handling to strncpy_from_user(). Linus removed the end-of-address-space hackery from fs/namei.c:do_getname() so we really have to validate these edge conditions and cannot cheat any more (as x86 used to as well). Move to a common C implementation like x86 did. And if both src and dst are sufficiently aligned we'll do word at a time copies and checks as well. Signed-off-by: David S. Miller --- arch/sparc/include/asm/uaccess_32.h | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'arch/sparc/include/asm/uaccess_32.h') diff --git a/arch/sparc/include/asm/uaccess_32.h b/arch/sparc/include/asm/uaccess_32.h index d50c310f5d38..59586b57ef1a 100644 --- a/arch/sparc/include/asm/uaccess_32.h +++ b/arch/sparc/include/asm/uaccess_32.h @@ -304,16 +304,6 @@ static inline unsigned long clear_user(void __user *addr, unsigned long n) return n; } -extern long __strncpy_from_user(char *dest, const char __user *src, long count); - -static inline long strncpy_from_user(char *dest, const char __user *src, long count) -{ - if (__access_ok((unsigned long) src, count)) - return __strncpy_from_user(dest, src, count); - else - return -EFAULT; -} - extern long __strlen_user(const char __user *); extern long __strnlen_user(const char __user *, long len); -- cgit v1.2.3