Skip to content

Commit

Permalink
maccess: remove various unused weak aliases
Browse files Browse the repository at this point in the history
maccess tends to define lots of underscore prefixed symbols that then
have other weak aliases.  But except for two cases they are never
actually used, so remove them.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Christoph Hellwig <[email protected]>
Cc: Alexei Starovoitov <[email protected]>
Cc: Daniel Borkmann <[email protected]>
Cc: "H. Peter Anvin" <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Masami Hiramatsu <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Stephen Rothwell <[email protected]>
  • Loading branch information
Christoph Hellwig authored and sfrothwell committed Jun 5, 2020
1 parent 4cc91ee commit ef3e9e0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 19 deletions.
3 changes: 0 additions & 3 deletions include/linux/uaccess.h
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,6 @@ extern long __probe_kernel_read(void *dst, const void *src, size_t size);
* happens, handle that and return -EFAULT.
*/
extern long probe_user_read(void *dst, const void __user *src, size_t size);
extern long __probe_user_read(void *dst, const void __user *src, size_t size);

/*
* probe_kernel_write(): safely attempt to write to a location
Expand All @@ -336,7 +335,6 @@ extern long __probe_user_read(void *dst, const void __user *src, size_t size);
* happens, handle that and return -EFAULT.
*/
extern long notrace probe_kernel_write(void *dst, const void *src, size_t size);
extern long notrace __probe_kernel_write(void *dst, const void *src, size_t size);

/*
* probe_user_write(): safely attempt to write to a location in user space
Expand All @@ -348,7 +346,6 @@ extern long notrace __probe_kernel_write(void *dst, const void *src, size_t size
* happens, handle that and return -EFAULT.
*/
extern long notrace probe_user_write(void __user *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);
extern long strncpy_from_unsafe_strict(char *dst, const void *unsafe_addr,
Expand Down
19 changes: 3 additions & 16 deletions mm/maccess.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,7 @@ EXPORT_SYMBOL_GPL(probe_kernel_read);
* Safely read from user address @src to the buffer at @dst. If a kernel fault
* happens, handle that and return -EFAULT.
*/

long __weak probe_user_read(void *dst, const void __user *src, size_t size)
__attribute__((alias("__probe_user_read")));

long __probe_user_read(void *dst, const void __user *src, size_t size)
long probe_user_read(void *dst, const void __user *src, size_t size)
{
long ret = -EFAULT;
mm_segment_t old_fs = get_fs();
Expand All @@ -106,11 +102,7 @@ EXPORT_SYMBOL_GPL(probe_user_read);
* Safely write to address @dst from the buffer at @src. If a kernel fault
* happens, handle that and return -EFAULT.
*/

long __weak probe_kernel_write(void *dst, const void *src, size_t size)
__attribute__((alias("__probe_kernel_write")));

long __probe_kernel_write(void *dst, const void *src, size_t size)
long probe_kernel_write(void *dst, const void *src, size_t size)
{
long ret;
mm_segment_t old_fs = get_fs();
Expand All @@ -131,11 +123,7 @@ long __probe_kernel_write(void *dst, const void *src, size_t size)
* Safely write to address @dst from the buffer at @src. If a kernel fault
* happens, handle that and return -EFAULT.
*/

long __weak probe_user_write(void __user *dst, const void *src, size_t size)
__attribute__((alias("__probe_user_write")));

long __probe_user_write(void __user *dst, const void *src, size_t size)
long probe_user_write(void __user *dst, const void *src, size_t size)
{
long ret = -EFAULT;
mm_segment_t old_fs = get_fs();
Expand Down Expand Up @@ -171,7 +159,6 @@ long __probe_user_write(void __user *dst, const void *src, size_t size)
* probing memory on a user address range where strncpy_from_unsafe_user() is
* supposed to be used instead.
*/

long __weak strncpy_from_unsafe(char *dst, const void *unsafe_addr, long count)
__attribute__((alias("__strncpy_from_unsafe")));

Expand Down

0 comments on commit ef3e9e0

Please sign in to comment.