summaryrefslogtreecommitdiffstats
path: root/lib/strnlen_user.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2017-04-07 23:20:01 +0200
committerAl Viro <viro@zeniv.linux.org.uk>2017-05-16 05:40:22 +0200
commit82985258390e85289940d3663344197344e071f2 (patch)
tree9209037b20e4c5117b87a03e0add1c305c4eb25f /lib/strnlen_user.c
parentLinux 4.12-rc1 (diff)
downloadlinux-82985258390e85289940d3663344197344e071f2.tar.xz
linux-82985258390e85289940d3663344197344e071f2.zip
kill strlen_user()
no callers, no consistent semantics, no sane way to use it... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'lib/strnlen_user.c')
-rw-r--r--lib/strnlen_user.c34
1 files changed, 0 insertions, 34 deletions
diff --git a/lib/strnlen_user.c b/lib/strnlen_user.c
index 8e105ed4df12..a5f567747ced 100644
--- a/lib/strnlen_user.c
+++ b/lib/strnlen_user.c
@@ -121,37 +121,3 @@ long strnlen_user(const char __user *str, long count)
return 0;
}
EXPORT_SYMBOL(strnlen_user);
-
-/**
- * strlen_user: - Get the size of a user string INCLUDING final NUL.
- * @str: The string to measure.
- *
- * Context: User context only. This function may sleep if pagefaults are
- * enabled.
- *
- * Get the size of a NUL-terminated string in user space.
- *
- * Returns the size of the string INCLUDING the terminating NUL.
- * On exception, returns 0.
- *
- * If there is a limit on the length of a valid string, you may wish to
- * consider using strnlen_user() instead.
- */
-long strlen_user(const char __user *str)
-{
- unsigned long max_addr, src_addr;
-
- max_addr = user_addr_max();
- src_addr = (unsigned long)str;
- if (likely(src_addr < max_addr)) {
- unsigned long max = max_addr - src_addr;
- long retval;
-
- user_access_begin();
- retval = do_strnlen_user(str, ~0ul, max);
- user_access_end();
- return retval;
- }
- return 0;
-}
-EXPORT_SYMBOL(strlen_user);