Commit 6144a85a authored by Jason Wessel's avatar Jason Wessel

maccess,probe_kernel: Allow arch specific override probe_kernel_(read|write)

Some archs such as blackfin, would like to have an arch specific
probe_kernel_read() and probe_kernel_write() implementation which can
fall back to the generic implementation if no special operations are
needed.

CC: Thomas Gleixner <tglx@linutronix.de>
CC: Ingo Molnar <mingo@elte.hu>
Signed-off-by: default avatarJason Wessel <jason.wessel@windriver.com>
Signed-off-by: default avatarMike Frysinger <vapier@gentoo.org>
parent 2c1f1895
...@@ -94,6 +94,7 @@ static inline unsigned long __copy_from_user_nocache(void *to, ...@@ -94,6 +94,7 @@ static inline unsigned long __copy_from_user_nocache(void *to,
* happens, handle that and return -EFAULT. * happens, handle that and return -EFAULT.
*/ */
extern long probe_kernel_read(void *dst, void *src, size_t size); extern long probe_kernel_read(void *dst, void *src, size_t size);
extern long __probe_kernel_read(void *dst, void *src, size_t size);
/* /*
* probe_kernel_write(): safely attempt to write to a location * probe_kernel_write(): safely attempt to write to a location
...@@ -104,6 +105,7 @@ extern long probe_kernel_read(void *dst, void *src, size_t size); ...@@ -104,6 +105,7 @@ extern long probe_kernel_read(void *dst, void *src, size_t size);
* Safely write to address @dst from the buffer at @src. If a kernel fault * Safely write to address @dst from the buffer at @src. If a kernel fault
* happens, handle that and return -EFAULT. * happens, handle that and return -EFAULT.
*/ */
extern long probe_kernel_write(void *dst, void *src, size_t size); extern long notrace probe_kernel_write(void *dst, void *src, size_t size);
extern long notrace __probe_kernel_write(void *dst, void *src, size_t size);
#endif /* __LINUX_UACCESS_H__ */ #endif /* __LINUX_UACCESS_H__ */
...@@ -14,7 +14,11 @@ ...@@ -14,7 +14,11 @@
* Safely read from address @src to the buffer at @dst. If a kernel fault * Safely read from address @src to the buffer at @dst. If a kernel fault
* happens, handle that and return -EFAULT. * happens, handle that and return -EFAULT.
*/ */
long probe_kernel_read(void *dst, void *src, size_t size)
long __weak probe_kernel_read(void *dst, void *src, size_t size)
__attribute__((alias("__probe_kernel_read")));
long __probe_kernel_read(void *dst, void *src, size_t size)
{ {
long ret; long ret;
mm_segment_t old_fs = get_fs(); mm_segment_t old_fs = get_fs();
...@@ -39,7 +43,10 @@ EXPORT_SYMBOL_GPL(probe_kernel_read); ...@@ -39,7 +43,10 @@ EXPORT_SYMBOL_GPL(probe_kernel_read);
* Safely write to address @dst from the buffer at @src. If a kernel fault * Safely write to address @dst from the buffer at @src. If a kernel fault
* happens, handle that and return -EFAULT. * happens, handle that and return -EFAULT.
*/ */
long notrace __weak probe_kernel_write(void *dst, void *src, size_t size) long __weak probe_kernel_write(void *dst, void *src, size_t size)
__attribute__((alias("__probe_kernel_write")));
long __probe_kernel_write(void *dst, void *src, size_t size)
{ {
long ret; long ret;
mm_segment_t old_fs = get_fs(); mm_segment_t old_fs = get_fs();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment