Skip to content

Commit 02dddb1

Browse files
Christoph Hellwigtorvalds
authored andcommitted
maccess: rename strnlen_unsafe_user to strnlen_user_nofault
This matches the naming of strnlen_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-9-hch@lst.de Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent c4cb164 commit 02dddb1

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎include/linux/uaccess.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ long strncpy_from_kernel_nofault(char *dst, const void *unsafe_addr,
315315
extern long __strncpy_from_unsafe(char *dst, const void *unsafe_addr, long count);
316316
long strncpy_from_user_nofault(char *dst, const void __user *unsafe_addr,
317317
long count);
318-
extern long strnlen_unsafe_user(const void __user *unsafe_addr, long count);
318+
long strnlen_user_nofault(const void __user *unsafe_addr, long count);
319319

320320
/**
321321
* probe_kernel_address(): safely attempt to read from a location

‎kernel/trace/trace_kprobe.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1221,7 +1221,7 @@ fetch_store_strlen_user(unsigned long addr)
12211221
{
12221222
const void __user *uaddr = (__force const void __user *)addr;
12231223

1224-
return strnlen_unsafe_user(uaddr, MAX_STRING_SIZE);
1224+
return strnlen_user_nofault(uaddr, MAX_STRING_SIZE);
12251225
}
12261226

12271227
/*

‎mm/maccess.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ long strncpy_from_user_nofault(char *dst, const void __user *unsafe_addr,
260260
}
261261

262262
/**
263-
* strnlen_unsafe_user: - Get the size of a user string INCLUDING final NUL.
263+
* strnlen_user_nofault: - Get the size of a user string INCLUDING final NUL.
264264
* @unsafe_addr: The string to measure.
265265
* @count: Maximum count (including NUL)
266266
*
@@ -275,7 +275,7 @@ long strncpy_from_user_nofault(char *dst, const void __user *unsafe_addr,
275275
* Unlike strnlen_user, this can be used from IRQ handler etc. because
276276
* it disables pagefaults.
277277
*/
278-
long strnlen_unsafe_user(const void __user *unsafe_addr, long count)
278+
long strnlen_user_nofault(const void __user *unsafe_addr, long count)
279279
{
280280
mm_segment_t old_fs = get_fs();
281281
int ret;

0 commit comments

Comments
 (0)