mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-07 20:33:58 -04:00
BACKPORT: maccess: remove strncpy_from_unsafe
All users are gone now. 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-16-hch@lst.de Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Change-Id: Id1d12538ec284c86e4eb7b0d35e7bea07b20d617
This commit is contained in:
parent
5b25b56aa5
commit
2cce23ea9b
2 changed files with 0 additions and 39 deletions
|
|
@ -313,7 +313,6 @@ extern long probe_user_read(void *dst, const void __user *src, size_t size);
|
|||
extern long notrace probe_kernel_write(void *dst, const void *src, size_t size);
|
||||
extern long notrace probe_user_write(void __user *dst, const void *src, size_t size);
|
||||
|
||||
extern long strncpy_from_unsafe(char *dst, const void *unsafe_addr, long count);
|
||||
long strncpy_from_kernel_nofault(char *dst, const void *unsafe_addr,
|
||||
long count);
|
||||
|
||||
|
|
|
|||
38
mm/maccess.c
38
mm/maccess.c
|
|
@ -6,9 +6,6 @@
|
|||
#include <linux/mm.h>
|
||||
#include <linux/uaccess.h>
|
||||
|
||||
static long __strncpy_from_unsafe(char *dst, const void *unsafe_addr,
|
||||
long count, bool strict);
|
||||
|
||||
bool __weak probe_kernel_read_allowed(const void *unsafe_src, size_t size)
|
||||
{
|
||||
return true;
|
||||
|
|
@ -131,35 +128,6 @@ long probe_user_write(void __user *dst, const void *src, size_t size)
|
|||
}
|
||||
EXPORT_SYMBOL_GPL(probe_user_write);
|
||||
|
||||
/**
|
||||
* strncpy_from_unsafe: - Copy a NUL terminated string from unsafe address.
|
||||
* @dst: Destination address, in kernel space. This buffer must be at
|
||||
* least @count bytes long.
|
||||
* @unsafe_addr: Unsafe address.
|
||||
* @count: Maximum number of bytes to copy, including the trailing NUL.
|
||||
*
|
||||
* Copies a NUL-terminated string from unsafe address to kernel buffer.
|
||||
*
|
||||
* On success, returns the length of the string INCLUDING the trailing NUL.
|
||||
*
|
||||
* If access fails, returns -EFAULT (some data may have been copied
|
||||
* and the trailing NUL added).
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* Same as strncpy_from_kernel_nofault() except that for architectures with
|
||||
* not fully separated user and kernel address spaces this function also works
|
||||
* for user address tanges.
|
||||
*
|
||||
* DO NOT USE THIS FUNCTION - it is broken on architectures with entirely
|
||||
* separate kernel and user address spaces, and also a bad idea otherwise.
|
||||
*/
|
||||
long strncpy_from_unsafe(char *dst, const void *unsafe_addr, long count)
|
||||
{
|
||||
return __strncpy_from_unsafe(dst, unsafe_addr, count, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* strncpy_from_kernel_nofault: - Copy a NUL terminated string from unsafe
|
||||
* address.
|
||||
|
|
@ -179,12 +147,6 @@ long strncpy_from_unsafe(char *dst, const void *unsafe_addr, long count)
|
|||
* sets the last byte of @dst buffer to NUL and returns @count.
|
||||
*/
|
||||
long strncpy_from_kernel_nofault(char *dst, const void *unsafe_addr, long count)
|
||||
{
|
||||
return __strncpy_from_unsafe(dst, unsafe_addr, count, true);
|
||||
}
|
||||
|
||||
static long __strncpy_from_unsafe(char *dst, const void *unsafe_addr,
|
||||
long count, bool strict)
|
||||
{
|
||||
mm_segment_t old_fs = get_fs();
|
||||
const void *src = unsafe_addr;
|
||||
|
|
|
|||
Loading…
Reference in a new issue