summaryrefslogtreecommitdiff
path: root/arch/x86_64/lib/usercopy.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86_64/lib/usercopy.c')
-rw-r--r--arch/x86_64/lib/usercopy.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/arch/x86_64/lib/usercopy.c b/arch/x86_64/lib/usercopy.c
index db8abba..9bc2c29 100644
--- a/arch/x86_64/lib/usercopy.c
+++ b/arch/x86_64/lib/usercopy.c
@@ -109,14 +109,11 @@ unsigned long clear_user(void __user *to, unsigned long n)
* Return 0 on exception, a value greater than N if too long
*/
-long strnlen_user(const char __user *s, long n)
+long __strnlen_user(const char __user *s, long n)
{
long res = 0;
char c;
- if (!access_ok(VERIFY_READ, s, n))
- return 0;
-
while (1) {
if (res>n)
return n+1;
@@ -129,6 +126,13 @@ long strnlen_user(const char __user *s, long n)
}
}
+long strnlen_user(const char __user *s, long n)
+{
+ if (!access_ok(VERIFY_READ, s, n))
+ return 0;
+ return __strnlen_user(s, n);
+}
+
long strlen_user(const char __user *s)
{
long res = 0;