kill strlen_user()
authorAl Viro <viro@zeniv.linux.org.uk>
Fri, 7 Apr 2017 21:20:01 +0000 (17:20 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Tue, 16 May 2017 03:40:22 +0000 (23:40 -0400)
no callers, no consistent semantics, no sane way to use it...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
32 files changed:
arch/alpha/include/asm/uaccess.h
arch/arm/include/asm/uaccess.h
arch/arm64/include/asm/uaccess.h
arch/blackfin/include/asm/uaccess.h
arch/cris/include/asm/uaccess.h
arch/frv/include/asm/uaccess.h
arch/ia64/include/asm/uaccess.h
arch/ia64/lib/Makefile
arch/ia64/lib/strlen_user.S [deleted file]
arch/m32r/include/asm/uaccess.h
arch/m68k/include/asm/uaccess_mm.h
arch/m68k/include/asm/uaccess_no.h
arch/metag/include/asm/uaccess.h
arch/mips/include/asm/uaccess.h
arch/mips/lib/Makefile
arch/mips/lib/strlen_user.S [deleted file]
arch/mn10300/include/asm/uaccess.h
arch/openrisc/include/asm/uaccess.h
arch/parisc/include/asm/uaccess.h
arch/powerpc/include/asm/uaccess.h
arch/s390/include/asm/uaccess.h
arch/score/include/asm/uaccess.h
arch/score/lib/string.S
arch/sh/include/asm/uaccess.h
arch/sparc/include/asm/uaccess_32.h
arch/sparc/include/asm/uaccess_64.h
arch/tile/include/asm/uaccess.h
arch/um/kernel/process.c
arch/x86/include/asm/uaccess.h
arch/xtensa/include/asm/uaccess.h
include/asm-generic/uaccess.h
lib/strnlen_user.c

index 7b82dc9a8556260ffd66c19bd27d389431360c85..133a4884ed441065cd98fd5f32ff7cde66a9ddb4 100644 (file)
@@ -326,7 +326,6 @@ clear_user(void __user *to, long len)
         (uaccess_kernel() ? ~0UL : TASK_SIZE)
 
 extern long strncpy_from_user(char *dest, const char __user *src, long count);
         (uaccess_kernel() ? ~0UL : TASK_SIZE)
 
 extern long strncpy_from_user(char *dest, const char __user *src, long count);
-extern __must_check long strlen_user(const char __user *str);
 extern __must_check long strnlen_user(const char __user *str, long n);
 
 #include <asm/extable.h>
 extern __must_check long strnlen_user(const char __user *str, long n);
 
 #include <asm/extable.h>
index 2577405d082dab01004f13adee7a91398942d399..6838abc04279c98cbd23d80a6b59d54922ff3df3 100644 (file)
@@ -526,7 +526,6 @@ static inline unsigned long __must_check clear_user(void __user *to, unsigned lo
 /* These are from lib/ code, and use __get_user() and friends */
 extern long strncpy_from_user(char *dest, const char __user *src, long count);
 
 /* These are from lib/ code, and use __get_user() and friends */
 extern long strncpy_from_user(char *dest, const char __user *src, long count);
 
-extern __must_check long strlen_user(const char __user *str);
 extern __must_check long strnlen_user(const char __user *str, long n);
 
 #endif /* _ASMARM_UACCESS_H */
 extern __must_check long strnlen_user(const char __user *str, long n);
 
 #endif /* _ASMARM_UACCESS_H */
index 7b8a04789cef69e161f3956ce42a7d608884698e..59f09e6a6cb8eb9bad0a8b11a9d94ec46de394d7 100644 (file)
@@ -349,7 +349,6 @@ static inline unsigned long __must_check clear_user(void __user *to, unsigned lo
 
 extern long strncpy_from_user(char *dest, const char __user *src, long count);
 
 
 extern long strncpy_from_user(char *dest, const char __user *src, long count);
 
-extern __must_check long strlen_user(const char __user *str);
 extern __must_check long strnlen_user(const char __user *str, long n);
 
 #endif /* __ASM_UACCESS_H */
 extern __must_check long strnlen_user(const char __user *str, long n);
 
 #endif /* __ASM_UACCESS_H */
index f54a34f31cea82fe73f9fd3bdf3a4149789d9cb5..45da4bcb050eda9ad0cbd32ee976cdf532f7f8a5 100644 (file)
@@ -194,13 +194,6 @@ static inline long __must_check strnlen_user(const char __user *src, long n)
        return strnlen((const char __force *)src, n) + 1;
 }
 
        return strnlen((const char __force *)src, n) + 1;
 }
 
-static inline long __must_check strlen_user(const char __user *src)
-{
-       if (!access_ok(VERIFY_READ, src, 1))
-               return 0;
-       return strlen((const char __force *)src) + 1;
-}
-
 /*
  * Zero Userspace
  */
 /*
  * Zero Userspace
  */
index 0d473aec3066cad4fd6c25f8cd15e88d947c7a9f..98bfa4e060daf820244b8d773f9da42581dbc29f 100644 (file)
@@ -363,6 +363,4 @@ __clear_user(void __user *to, unsigned long n)
        return __do_clear_user(to, n);
 }
 
        return __do_clear_user(to, n);
 }
 
-#define strlen_user(str)       strnlen_user((str), 0x7ffffffe)
-
 #endif /* _CRIS_UACCESS_H */
 #endif /* _CRIS_UACCESS_H */
index e4e33b4cd3aeaea84b8ffa58c1895f07dd2cd643..ff9562dc682502096c638b9c0de1661336f5c6aa 100644 (file)
@@ -282,6 +282,4 @@ clear_user(void __user *to, unsigned long n)
 extern long strncpy_from_user(char *dst, const char __user *src, long count);
 extern long strnlen_user(const char __user *src, long count);
 
 extern long strncpy_from_user(char *dst, const char __user *src, long count);
 extern long strnlen_user(const char __user *src, long count);
 
-#define strlen_user(str) strnlen_user(str, 32767)
-
 #endif /* _ASM_UACCESS_H */
 #endif /* _ASM_UACCESS_H */
index 82a7646c4416a515813db5429e3a59e64c14207d..b2106b01e84f1d5f4205478182396841903aa107 100644 (file)
@@ -277,18 +277,6 @@ extern long __must_check __strncpy_from_user (char *to, const char __user *from,
        __sfu_ret;                                                      \
 })
 
        __sfu_ret;                                                      \
 })
 
-/* Returns: 0 if bad, string length+1 (memory size) of string if ok */
-extern unsigned long __strlen_user (const char __user *);
-
-#define strlen_user(str)                               \
-({                                                     \
-       const char __user *__su_str = (str);            \
-       unsigned long __su_ret = 0;                     \
-       if (__access_ok(__su_str, 0))                   \
-               __su_ret = __strlen_user(__su_str);     \
-       __su_ret;                                       \
-})
-
 /*
  * Returns: 0 if exception before NUL or reaching the supplied limit
  * (N), a value greater than N if the limit would be exceeded, else
 /*
  * Returns: 0 if exception before NUL or reaching the supplied limit
  * (N), a value greater than N if the limit would be exceeded, else
index 0a40b14407b1692c7a684bb2ea689d130df36805..1a36a3a39624c16cf78a7d539cc870fdf66fbd0f 100644 (file)
@@ -5,7 +5,7 @@
 lib-y := io.o __divsi3.o __udivsi3.o __modsi3.o __umodsi3.o            \
        __divdi3.o __udivdi3.o __moddi3.o __umoddi3.o                   \
        checksum.o clear_page.o csum_partial_copy.o                     \
 lib-y := io.o __divsi3.o __udivsi3.o __modsi3.o __umodsi3.o            \
        __divdi3.o __udivdi3.o __moddi3.o __umoddi3.o                   \
        checksum.o clear_page.o csum_partial_copy.o                     \
-       clear_user.o strncpy_from_user.o strlen_user.o strnlen_user.o   \
+       clear_user.o strncpy_from_user.o strnlen_user.o                 \
        flush.o ip_fast_csum.o do_csum.o                                \
        memset.o strlen.o xor.o
 
        flush.o ip_fast_csum.o do_csum.o                                \
        memset.o strlen.o xor.o
 
diff --git a/arch/ia64/lib/strlen_user.S b/arch/ia64/lib/strlen_user.S
deleted file mode 100644 (file)
index 9d25768..0000000
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- * Optimized version of the strlen_user() function
- *
- * Inputs:
- *     in0     address of buffer
- *
- * Outputs:
- *     ret0    0 in case of fault, strlen(buffer)+1 otherwise
- *
- * Copyright (C) 1998, 1999, 2001 Hewlett-Packard Co
- *     David Mosberger-Tang <davidm@hpl.hp.com>
- *     Stephane Eranian <eranian@hpl.hp.com>
- *
- * 01/19/99 S.Eranian heavily enhanced version (see details below)
- * 09/24/99 S.Eranian added speculation recovery code
- */
-
-#include <asm/asmmacro.h>
-#include <asm/export.h>
-
-//
-// int strlen_user(char *)
-// ------------------------
-// Returns:
-//     - length of string + 1
-//     - 0 in case an exception is raised
-//
-// This is an enhanced version of the basic strlen_user. it includes a
-// combination of compute zero index (czx), parallel comparisons, speculative
-// loads and loop unroll using rotating registers.
-//
-// General Ideas about the algorithm:
-//       The goal is to look at the string in chunks of 8 bytes.
-//       so we need to do a few extra checks at the beginning because the
-//       string may not be 8-byte aligned. In this case we load the 8byte
-//       quantity which includes the start of the string and mask the unused
-//       bytes with 0xff to avoid confusing czx.
-//       We use speculative loads and software pipelining to hide memory
-//       latency and do read ahead safely. This way we defer any exception.
-//
-//       Because we don't want the kernel to be relying on particular
-//       settings of the DCR register, we provide recovery code in case
-//       speculation fails. The recovery code is going to "redo" the work using
-//       only normal loads. If we still get a fault then we return an
-//       error (ret0=0). Otherwise we return the strlen+1 as usual.
-//       The fact that speculation may fail can be caused, for instance, by
-//       the DCR.dm bit being set. In this case TLB misses are deferred, i.e.,
-//       a NaT bit will be set if the translation is not present. The normal
-//       load, on the other hand, will cause the translation to be inserted
-//       if the mapping exists.
-//
-//       It should be noted that we execute recovery code only when we need
-//       to use the data that has been speculatively loaded: we don't execute
-//       recovery code on pure read ahead data.
-//
-// Remarks:
-//     - the cmp r0,r0 is used as a fast way to initialize a predicate
-//       register to 1. This is required to make sure that we get the parallel
-//       compare correct.
-//
-//     - we don't use the epilogue counter to exit the loop but we need to set
-//       it to zero beforehand.
-//
-//     - after the loop we must test for Nat values because neither the
-//       czx nor cmp instruction raise a NaT consumption fault. We must be
-//       careful not to look too far for a Nat for which we don't care.
-//       For instance we don't need to look at a NaT in val2 if the zero byte
-//       was in val1.
-//
-//     - Clearly performance tuning is required.
-//
-
-#define saved_pfs      r11
-#define        tmp             r10
-#define base           r16
-#define orig           r17
-#define saved_pr       r18
-#define src            r19
-#define mask           r20
-#define val            r21
-#define val1           r22
-#define val2           r23
-
-GLOBAL_ENTRY(__strlen_user)
-       .prologue
-       .save ar.pfs, saved_pfs
-       alloc saved_pfs=ar.pfs,11,0,0,8
-
-       .rotr v[2], w[2]        // declares our 4 aliases
-
-       extr.u tmp=in0,0,3      // tmp=least significant 3 bits
-       mov orig=in0            // keep trackof initial byte address
-       dep src=0,in0,0,3       // src=8byte-aligned in0 address
-       .save pr, saved_pr
-       mov saved_pr=pr         // preserve predicates (rotation)
-       ;;
-
-       .body
-
-       ld8.s v[1]=[src],8      // load the initial 8bytes (must speculate)
-       shl tmp=tmp,3           // multiply by 8bits/byte
-       mov mask=-1             // our mask
-       ;;
-       ld8.s w[1]=[src],8      // load next 8 bytes in 2nd pipeline
-       cmp.eq p6,p0=r0,r0      // sets p6 (required because of // cmp.and)
-       sub tmp=64,tmp          // how many bits to shift our mask on the right
-       ;;
-       shr.u   mask=mask,tmp   // zero enough bits to hold v[1] valuable part
-       mov ar.ec=r0            // clear epilogue counter (saved in ar.pfs)
-       ;;
-       add base=-16,src        // keep track of aligned base
-       chk.s v[1], .recover    // if already NaT, then directly skip to recover
-       or v[1]=v[1],mask       // now we have a safe initial byte pattern
-       ;;
-1:
-       ld8.s v[0]=[src],8      // speculatively load next
-       czx1.r val1=v[1]        // search 0 byte from right
-       czx1.r val2=w[1]        // search 0 byte from right following 8bytes
-       ;;
-       ld8.s w[0]=[src],8      // speculatively load next to next
-       cmp.eq.and p6,p0=8,val1 // p6 = p6 and val1==8
-       cmp.eq.and p6,p0=8,val2 // p6 = p6 and mask==8
-(p6)   br.wtop.dptk.few 1b     // loop until p6 == 0
-       ;;
-       //
-       // We must return try the recovery code iff
-       // val1_is_nat || (val1==8 && val2_is_nat)
-       //
-       // XXX Fixme
-       //      - there must be a better way of doing the test
-       //
-       cmp.eq  p8,p9=8,val1    // p6 = val1 had zero (disambiguate)
-       tnat.nz p6,p7=val1      // test NaT on val1
-(p6)   br.cond.spnt .recover   // jump to recovery if val1 is NaT
-       ;;
-       //
-       // if we come here p7 is true, i.e., initialized for // cmp
-       //
-       cmp.eq.and  p7,p0=8,val1// val1==8?
-       tnat.nz.and p7,p0=val2  // test NaT if val2
-(p7)   br.cond.spnt .recover   // jump to recovery if val2 is NaT
-       ;;
-(p8)   mov val1=val2           // val2 contains the value
-(p8)   adds src=-16,src        // correct position when 3 ahead
-(p9)   adds src=-24,src        // correct position when 4 ahead
-       ;;
-       sub ret0=src,orig       // distance from origin
-       sub tmp=7,val1          // 7=8-1 because this strlen returns strlen+1
-       mov pr=saved_pr,0xffffffffffff0000
-       ;;
-       sub ret0=ret0,tmp       // length=now - back -1
-       mov ar.pfs=saved_pfs    // because of ar.ec, restore no matter what
-       br.ret.sptk.many rp     // end of normal execution
-
-       //
-       // Outlined recovery code when speculation failed
-       //
-       // This time we don't use speculation and rely on the normal exception
-       // mechanism. that's why the loop is not as good as the previous one
-       // because read ahead is not possible
-       //
-       // XXX Fixme
-       //      - today we restart from the beginning of the string instead
-       //        of trying to continue where we left off.
-       //
-.recover:
-       EX(.Lexit1, ld8 val=[base],8)   // load the initial bytes
-       ;;
-       or val=val,mask                 // remask first bytes
-       cmp.eq p0,p6=r0,r0              // nullify first ld8 in loop
-       ;;
-       //
-       // ar.ec is still zero here
-       //
-2:
-       EX(.Lexit1, (p6) ld8 val=[base],8)
-       ;;
-       czx1.r val1=val         // search 0 byte from right
-       ;;
-       cmp.eq p6,p0=8,val1     // val1==8 ?
-(p6)   br.wtop.dptk.few 2b     // loop until p6 == 0
-       ;;
-       sub ret0=base,orig      // distance from base
-       sub tmp=7,val1          // 7=8-1 because this strlen returns strlen+1
-       mov pr=saved_pr,0xffffffffffff0000
-       ;;
-       sub ret0=ret0,tmp       // length=now - back -1
-       mov ar.pfs=saved_pfs    // because of ar.ec, restore no matter what
-       br.ret.sptk.many rp     // end of successful recovery code
-
-       //
-       // We failed even on the normal load (called from exception handler)
-       //
-.Lexit1:
-       mov ret0=0
-       mov pr=saved_pr,0xffffffffffff0000
-       mov ar.pfs=saved_pfs    // because of ar.ec, restore no matter what
-       br.ret.sptk.many rp
-END(__strlen_user)
-EXPORT_SYMBOL(__strlen_user)
index 07be349c00adcd755104d3fe5863d539891cfe1d..0273d0481edc3ad9e93e4421ff19e5746fa18255 100644 (file)
@@ -511,22 +511,6 @@ unsigned long __clear_user(void __user *mem, unsigned long len);
  */
 unsigned long clear_user(void __user *mem, unsigned long len);
 
  */
 unsigned long clear_user(void __user *mem, unsigned long len);
 
-/**
- * strlen_user: - Get the size of a string in user space.
- * @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.
- */
-#define strlen_user(str) strnlen_user(str, ~0UL >> 1)
 long strnlen_user(const char __user *str, long n);
 
 #endif /* _ASM_M32R_UACCESS_H */
 long strnlen_user(const char __user *str, long n);
 
 #endif /* _ASM_M32R_UACCESS_H */
index ef856ffeffdfca99ca091c0206717b4ef8da1e7a..1da1e23de74c5ed37cd42d6e5ad13499c1c63485 100644 (file)
@@ -378,7 +378,6 @@ raw_copy_to_user(void __user *to, const void *from, unsigned long n)
        (uaccess_kernel() ? ~0UL : TASK_SIZE)
 
 extern long strncpy_from_user(char *dst, const char __user *src, long count);
        (uaccess_kernel() ? ~0UL : TASK_SIZE)
 
 extern long strncpy_from_user(char *dst, const char __user *src, long count);
-extern __must_check long strlen_user(const char __user *str);
 extern __must_check long strnlen_user(const char __user *str, long n);
 
 unsigned long __clear_user(void __user *to, unsigned long n);
 extern __must_check long strnlen_user(const char __user *str, long n);
 
 unsigned long __clear_user(void __user *to, unsigned long n);
index e482c3899ff13992345ea3bc91ad463723d0cd64..53d7b792a43d93af873e1174aeda1a78a071dc62 100644 (file)
@@ -141,8 +141,6 @@ static inline long strnlen_user(const char *src, long n)
        return(strlen(src) + 1); /* DAVIDM make safer */
 }
 
        return(strlen(src) + 1); /* DAVIDM make safer */
 }
 
-#define strlen_user(str) strnlen_user(str, 32767)
-
 /*
  * Zero Userspace
  */
 /*
  * Zero Userspace
  */
index 9c8fbf8fb5aa2c5adbd0a5fc3c44d07666841a17..47469e26641aa0ea5093a8bde02e5c226d7a2ff3 100644 (file)
@@ -188,8 +188,6 @@ strncpy_from_user(char *dst, const char __user *src, long count)
  */
 extern long __must_check strnlen_user(const char __user *src, long count);
 
  */
 extern long __must_check strnlen_user(const char __user *src, long count);
 
-#define strlen_user(str) strnlen_user(str, 32767)
-
 extern unsigned long raw_copy_from_user(void *to, const void __user *from,
                                        unsigned long n);
 extern unsigned long raw_copy_to_user(void __user *to, const void *from,
 extern unsigned long raw_copy_from_user(void *to, const void __user *from,
                                        unsigned long n);
 extern unsigned long raw_copy_to_user(void __user *to, const void *from,
index 99e629a590a565c779df48eb62a4ce887b0428eb..846628eee108c5edb373ba1608e8b9dc4e2ea477 100644 (file)
@@ -1073,50 +1073,6 @@ strncpy_from_user(char *__to, const char __user *__from, long __len)
        return res;
 }
 
        return res;
 }
 
-extern long __strlen_kernel_asm(const char __user *s);
-extern long __strlen_user_asm(const char __user *s);
-
-/*
- * strlen_user: - Get the size of a string in user space.
- * @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.
- */
-static inline long strlen_user(const char __user *s)
-{
-       long res;
-
-       if (eva_kernel_access()) {
-               __asm__ __volatile__(
-                       "move\t$4, %1\n\t"
-                       __MODULE_JAL(__strlen_kernel_asm)
-                       "move\t%0, $2"
-                       : "=r" (res)
-                       : "r" (s)
-                       : "$2", "$4", __UA_t0, "$31");
-       } else {
-               might_fault();
-               __asm__ __volatile__(
-                       "move\t$4, %1\n\t"
-                       __MODULE_JAL(__strlen_user_asm)
-                       "move\t%0, $2"
-                       : "=r" (res)
-                       : "r" (s)
-                       : "$2", "$4", __UA_t0, "$31");
-       }
-
-       return res;
-}
-
 extern long __strnlen_kernel_nocheck_asm(const char __user *s, long n);
 extern long __strnlen_user_nocheck_asm(const char __user *s, long n);
 
 extern long __strnlen_kernel_nocheck_asm(const char __user *s, long n);
 extern long __strnlen_user_nocheck_asm(const char __user *s, long n);
 
index 0344e575f522982dc4725479d66544d79837b0b4..a37fe3d1ee2fbd6b0b0c52fb954daed9f8dfc03e 100644 (file)
@@ -3,7 +3,7 @@
 #
 
 lib-y  += bitops.o csum_partial.o delay.o memcpy.o memset.o \
 #
 
 lib-y  += bitops.o csum_partial.o delay.o memcpy.o memset.o \
-          mips-atomic.o strlen_user.o strncpy_user.o \
+          mips-atomic.o strncpy_user.o \
           strnlen_user.o uncached.o
 
 obj-y                  += iomap.o
           strnlen_user.o uncached.o
 
 obj-y                  += iomap.o
diff --git a/arch/mips/lib/strlen_user.S b/arch/mips/lib/strlen_user.S
deleted file mode 100644 (file)
index 40be226..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- *
- * Copyright (C) 1996, 1998, 1999, 2004 by Ralf Baechle
- * Copyright (C) 1999 Silicon Graphics, Inc.
- * Copyright (C) 2011 MIPS Technologies, Inc.
- */
-#include <asm/asm.h>
-#include <asm/asm-offsets.h>
-#include <asm/export.h>
-#include <asm/regdef.h>
-
-#define EX(insn,reg,addr,handler)                      \
-9:     insn    reg, addr;                              \
-       .section __ex_table,"a";                        \
-       PTR     9b, handler;                            \
-       .previous
-
-/*
- * Return the size of a string (including the ending 0)
- *
- * Return 0 for error
- */
-       .macro __BUILD_STRLEN_ASM func
-LEAF(__strlen_\func\()_asm)
-       LONG_L          v0, TI_ADDR_LIMIT($28)  # pointer ok?
-       and             v0, a0
-       bnez            v0, .Lfault\@
-
-       move            v0, a0
-.ifeqs "\func", "kernel"
-1:     EX(lbu, v1, (v0), .Lfault\@)
-.else
-1:     EX(lbue, v1, (v0), .Lfault\@)
-.endif
-       PTR_ADDIU       v0, 1
-       bnez            v1, 1b
-       PTR_SUBU        v0, a0
-       jr              ra
-       END(__strlen_\func\()_asm)
-
-.Lfault\@:     move            v0, zero
-       jr              ra
-       .endm
-
-#ifndef CONFIG_EVA
-       /* Set aliases */
-       .global __strlen_user_asm
-       .set __strlen_user_asm, __strlen_kernel_asm
-EXPORT_SYMBOL(__strlen_user_asm)
-#endif
-
-__BUILD_STRLEN_ASM kernel
-EXPORT_SYMBOL(__strlen_kernel_asm)
-
-#ifdef CONFIG_EVA
-
-       .set push
-       .set eva
-__BUILD_STRLEN_ASM user
-       .set pop
-EXPORT_SYMBOL(__strlen_user_asm)
-#endif
index c6966474827f114c99f1eb2b90d40fd3980e3e15..2e04ebb711c4c394ae8114d00f2b09c8bfb98fbf 100644 (file)
@@ -292,7 +292,6 @@ raw_copy_to_user(void __user *to, const void *from, unsigned long n)
 extern long strncpy_from_user(char *dst, const char __user *src, long count);
 extern long __strncpy_from_user(char *dst, const char __user *src, long count);
 extern long strnlen_user(const char __user *str, long n);
 extern long strncpy_from_user(char *dst, const char __user *src, long count);
 extern long __strncpy_from_user(char *dst, const char __user *src, long count);
 extern long strnlen_user(const char __user *str, long n);
-#define strlen_user(str) strnlen_user(str, ~0UL >> 1)
 extern unsigned long clear_user(void __user *mem, unsigned long len);
 extern unsigned long __clear_user(void __user *mem, unsigned long len);
 
 extern unsigned long clear_user(void __user *mem, unsigned long len);
 extern unsigned long __clear_user(void __user *mem, unsigned long len);
 
index a557a7cd02324c1468fd6407b989614544f00d00..bbf5c79cce7a30832422c1a290e895074fab1042 100644 (file)
@@ -264,7 +264,6 @@ clear_user(void *addr, unsigned long size)
 
 extern long strncpy_from_user(char *dest, const char __user *src, long count);
 
 
 extern long strncpy_from_user(char *dest, const char __user *src, long count);
 
-extern __must_check long strlen_user(const char __user *str);
 extern __must_check long strnlen_user(const char __user *str, long n);
 
 #endif /* __ASM_OPENRISC_UACCESS_H */
 extern __must_check long strnlen_user(const char __user *str, long n);
 
 #endif /* __ASM_OPENRISC_UACCESS_H */
index 6b113f39f30c9b34aa1bc6784af4b0c60ccf3074..44299a21d687664b6789d9ff93cfa95f0024f274 100644 (file)
@@ -220,7 +220,6 @@ extern long lstrnlen_user(const char __user *, long);
 #define user_addr_max() (~0UL)
 
 #define strnlen_user lstrnlen_user
 #define user_addr_max() (~0UL)
 
 #define strnlen_user lstrnlen_user
-#define strlen_user(str) lstrnlen_user(str, 0x7fffffffL)
 #define clear_user lclear_user
 #define __clear_user lclear_user
 
 #define clear_user lclear_user
 #define __clear_user lclear_user
 
index 5c0d8a8cdae5b588ac1254882c90787f81c40052..c67e0af8d12ea185d422435690013c83e5db9fee 100644 (file)
@@ -346,7 +346,6 @@ static inline unsigned long clear_user(void __user *addr, unsigned long size)
 }
 
 extern long strncpy_from_user(char *dst, const char __user *src, long count);
 }
 
 extern long strncpy_from_user(char *dst, const char __user *src, long count);
-extern __must_check long strlen_user(const char __user *str);
 extern __must_check long strnlen_user(const char __user *str, long n);
 
 #endif /* _ARCH_POWERPC_UACCESS_H */
 extern __must_check long strnlen_user(const char __user *str, long n);
 
 #endif /* _ARCH_POWERPC_UACCESS_H */
index 78f3f093d1437f07f484fa64a2f4ef5f533fd070..28b528197cf5648b43f16378e480ee434c01e3de 100644 (file)
@@ -276,23 +276,6 @@ static inline unsigned long strnlen_user(const char __user *src, unsigned long n
        return __strnlen_user(src, n);
 }
 
        return __strnlen_user(src, n);
 }
 
-/**
- * strlen_user: - Get the size of a string in user space.
- * @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.
- */
-#define strlen_user(str) strnlen_user(str, ~0UL)
-
 /*
  * Zero Userspace
  */
 /*
  * Zero Userspace
  */
index 916e5dbf0bfdbb09bc0b2adcb9aef1e33d997ad5..0ef220474d9b2d4eeec79e04228a3bf107460154 100644 (file)
@@ -359,12 +359,6 @@ static inline int strncpy_from_user(char *dst, const char *src, long len)
        return -EFAULT;
 }
 
        return -EFAULT;
 }
 
-extern int __strlen_user(const char *src);
-static inline long strlen_user(const char __user *src)
-{
-       return __strlen_user(src);
-}
-
 extern int __strnlen_user(const char *str, long len);
 static inline long strnlen_user(const char __user *str, long len)
 {
 extern int __strnlen_user(const char *str, long len);
 static inline long strnlen_user(const char __user *str, long len)
 {
index 16efa3ad037f7cffbdbb4a5ffcf57a5d25325648..e0c0318c90107007c3d0cdc594af4a34e6eb9fd6 100644 (file)
@@ -103,34 +103,6 @@ ENTRY(__strnlen_user)
        .word   1b, 99b
        .previous
 
        .word   1b, 99b
        .previous
 
-       .align 2
-ENTRY(__strlen_user)
-0:     lb      r6, [r4]
-       mv      r7, r4
-       extsb   r6, r6
-       cmpi.c  r6, 0
-       mv      r4, r6
-       beq     .L27
-.L28:
-1:     lb      r6, [r7, 1]+
-       addi    r6, 1
-       cmpi.c  r6, 0
-       bne     .L28
-.L27:
-       br      r3
-       .section .fixup, "ax"
-       ldi     r4, 0x0
-       br      r3
-99:
-       ldi     r4, 0
-       br      r3
-       .previous
-       .section __ex_table, "a"
-       .align  2
-       .word   0b ,99b
-       .word   1b ,99b
-       .previous
-
        .align 2
 ENTRY(__copy_tofrom_user)
        cmpi.c  r6, 0
        .align 2
 ENTRY(__copy_tofrom_user)
        cmpi.c  r6, 0
index 2722b61b228389315c2cf4e74d4058d8dfde7bac..211b44920dbe705e8af5487ff88a8d0ed5b68310 100644 (file)
@@ -100,7 +100,6 @@ struct __large_struct { unsigned long buf[100]; };
 
 extern long strncpy_from_user(char *dest, const char __user *src, long count);
 
 
 extern long strncpy_from_user(char *dest, const char __user *src, long count);
 
-extern __must_check long strlen_user(const char __user *str);
 extern __must_check long strnlen_user(const char __user *str, long n);
 
 /* Generic arbitrary sized copy.  */
 extern __must_check long strnlen_user(const char __user *str, long n);
 
 /* Generic arbitrary sized copy.  */
index 12ebee2d97c7bc1b61c9afe65e996ca039aafc7e..bdb1447aa1bb7cd061125f064cdb6526d8ddc5ef 100644 (file)
@@ -277,7 +277,6 @@ static inline unsigned long clear_user(void __user *addr, unsigned long n)
                return n;
 }
 
                return n;
 }
 
-__must_check long strlen_user(const char __user *str);
 __must_check long strnlen_user(const char __user *str, long n);
 
 #endif /* _ASM_UACCESS_H */
 __must_check long strnlen_user(const char __user *str, long n);
 
 #endif /* _ASM_UACCESS_H */
index 6096d671aa63a797a92fdc13a62a4607d9766c72..113d84eaa15e3ed9d491d2bb012405208d225fd0 100644 (file)
@@ -194,7 +194,6 @@ unsigned long __must_check __clear_user(void __user *, unsigned long);
 
 #define clear_user __clear_user
 
 
 #define clear_user __clear_user
 
-__must_check long strlen_user(const char __user *str);
 __must_check long strnlen_user(const char __user *str, long n);
 
 struct pt_regs;
 __must_check long strnlen_user(const char __user *str, long n);
 
 struct pt_regs;
index a803f6bb4d9296bad4b35043230bda9b4cb6b8e5..d0c79c1c54b404518a774abcffac75026a2f877d 100644 (file)
@@ -327,7 +327,6 @@ extern unsigned long raw_copy_in_user(
 
 
 extern long strnlen_user(const char __user *str, long n);
 
 
 extern long strnlen_user(const char __user *str, long n);
-extern long strlen_user(const char __user *str);
 extern long strncpy_from_user(char *dst, const char __user *src, long);
 
 /**
 extern long strncpy_from_user(char *dst, const char __user *src, long);
 
 /**
index a9bd618200429c99eaaa040076741438dd44597e..2c7f721eccbcb2b45799a380cfddb9327c0d509c 100644 (file)
@@ -255,11 +255,6 @@ int clear_user_proc(void __user *buf, int size)
        return clear_user(buf, size);
 }
 
        return clear_user(buf, size);
 }
 
-int strlen_user_proc(char __user *str)
-{
-       return strlen_user(str);
-}
-
 int cpu(void)
 {
        return current_thread_info()->cpu;
 int cpu(void)
 {
        return current_thread_info()->cpu;
index 68766b276d9eea540ef6aad3f43d4b52e6b8bf54..ff5d391ba9027e61b2f2436e14de2007958b0802 100644 (file)
@@ -565,7 +565,6 @@ copy_from_user_nmi(void *to, const void __user *from, unsigned long n);
 extern __must_check long
 strncpy_from_user(char *dst, const char __user *src, long count);
 
 extern __must_check long
 strncpy_from_user(char *dst, const char __user *src, long count);
 
-extern __must_check long strlen_user(const char __user *str);
 extern __must_check long strnlen_user(const char __user *str, long n);
 
 unsigned long __must_check clear_user(void __user *mem, unsigned long len);
 extern __must_check long strnlen_user(const char __user *str, long n);
 
 unsigned long __must_check clear_user(void __user *mem, unsigned long len);
index 2e7bac0d4b2cbd58fc3f7749ed2fc4b45920db9f..c0714b471ef45de2d3da93b67b33f01a34da9f40 100644 (file)
@@ -288,9 +288,6 @@ strncpy_from_user(char *dst, const char *src, long count)
        return -EFAULT;
 }
 
        return -EFAULT;
 }
 
-
-#define strlen_user(str) strnlen_user((str), TASK_SIZE - 1)
-
 /*
  * Return the size of a string (including the ending 0!)
  */
 /*
  * Return the size of a string (including the ending 0!)
  */
index bbe4bb438e3934e99748bf9c1a815ace2b0fda7f..723e81a6c162052e82849864d37794541ac82f38 100644 (file)
@@ -200,11 +200,6 @@ static inline long strnlen_user(const char __user *src, long n)
        return __strnlen_user(src, n);
 }
 
        return __strnlen_user(src, n);
 }
 
-static inline long strlen_user(const char __user *src)
-{
-       return strnlen_user(src, 32767);
-}
-
 /*
  * Zero Userspace
  */
 /*
  * Zero Userspace
  */
index 8e105ed4df12bb6bb0a170afff54d979c15d73c0..a5f567747cedaf411b09a002f2ec242ca57ee571 100644 (file)
@@ -121,37 +121,3 @@ long strnlen_user(const char __user *str, long count)
        return 0;
 }
 EXPORT_SYMBOL(strnlen_user);
        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);