]> git.baikalelectronics.ru Git - kernel.git/commitdiff
maccess: rename strncpy_from_unsafe_user to strncpy_from_user_nofault
authorChristoph Hellwig <hch@lst.de>
Tue, 9 Jun 2020 04:34:14 +0000 (21:34 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 9 Jun 2020 16:39:15 +0000 (09:39 -0700)
This matches the naming of strncpy_from_user, and also makes it more
clear what the function is supposed to do.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20200521152301.2587579-7-hch@lst.de
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/uaccess.h
kernel/trace/bpf_trace.c
kernel/trace/trace_kprobe.c
mm/maccess.c

index 4f4622b01a50f9972137bafb1506405fd47e54c1..d1a4fa66067c68d3f81f7ded161ee625346a4a63 100644 (file)
@@ -313,8 +313,8 @@ extern long strncpy_from_unsafe(char *dst, const void *unsafe_addr, long count);
 extern long strncpy_from_unsafe_strict(char *dst, const void *unsafe_addr,
                                       long count);
 extern long __strncpy_from_unsafe(char *dst, const void *unsafe_addr, long count);
-extern long strncpy_from_unsafe_user(char *dst, const void __user *unsafe_addr,
-                                    long count);
+long strncpy_from_user_nofault(char *dst, const void __user *unsafe_addr,
+               long count);
 extern long strnlen_unsafe_user(const void __user *unsafe_addr, long count);
 
 /**
index 3744372a24e2076fafcf9c51ad369627c26566cf..334db5a299a014f8a33c72a3e1516be02d08dcf6 100644 (file)
@@ -159,7 +159,7 @@ const struct bpf_func_proto bpf_probe_read_user_proto = {
 BPF_CALL_3(bpf_probe_read_user_str, void *, dst, u32, size,
           const void __user *, unsafe_ptr)
 {
-       int ret = strncpy_from_unsafe_user(dst, unsafe_ptr, size);
+       int ret = strncpy_from_user_nofault(dst, unsafe_ptr, size);
 
        if (unlikely(ret < 0))
                memset(dst, 0, size);
@@ -419,7 +419,7 @@ fmt_str:
                                                           sizeof(buf));
                                break;
                        case 'u':
-                               strncpy_from_unsafe_user(buf,
+                               strncpy_from_user_nofault(buf,
                                        (__force void __user *)unsafe_ptr,
                                                         sizeof(buf));
                                break;
index 35989383ae1131e11e45a39e0a5333a57f4493e0..d600f41fda1ca43b578f1aba5eaf833bd034fd66 100644 (file)
@@ -1268,7 +1268,7 @@ fetch_store_string_user(unsigned long addr, void *dest, void *base)
 
        __dest = get_loc_data(dest, base);
 
-       ret = strncpy_from_unsafe_user(__dest, uaddr, maxlen);
+       ret = strncpy_from_user_nofault(__dest, uaddr, maxlen);
        if (ret >= 0)
                *(u32 *)dest = make_data_loc(ret, __dest - base);
 
index b3e15a8ec80fa0b345b0db9efa0577d4948d1ca0..41a494e3deac8fa27f0cddfe7378932a9d405e09 100644 (file)
@@ -217,7 +217,7 @@ long __strncpy_from_unsafe(char *dst, const void *unsafe_addr, long count)
 }
 
 /**
- * strncpy_from_unsafe_user: - Copy a NUL terminated string from unsafe user
+ * strncpy_from_user_nofault: - Copy a NUL terminated string from unsafe user
  *                             address.
  * @dst:   Destination address, in kernel space.  This buffer must be at
  *         least @count bytes long.
@@ -234,7 +234,7 @@ long __strncpy_from_unsafe(char *dst, const void *unsafe_addr, long count)
  * If @count is smaller than the length of the string, copies @count-1 bytes,
  * sets the last byte of @dst buffer to NUL and returns @count.
  */
-long strncpy_from_unsafe_user(char *dst, const void __user *unsafe_addr,
+long strncpy_from_user_nofault(char *dst, const void __user *unsafe_addr,
                              long count)
 {
        mm_segment_t old_fs = get_fs();