summaryrefslogtreecommitdiff
path: root/arch/parisc/lib
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2016-10-06 10:07:30 +0300
committerHelge Deller <deller@gmx.de>2016-10-06 23:10:19 +0300
commit9e91db6b4abecd58647a5e984d538187f1c2ea09 (patch)
tree40f94e8c4561e7214784995cb03a828f27df3737 /arch/parisc/lib
parentf39cce654f9a1df331d7e1ba703f5f06a79f2159 (diff)
downloadlinux-9e91db6b4abecd58647a5e984d538187f1c2ea09.tar.xz
parisc: Add hardened usercopy feature
Add hardened usercopy checks to parisc architecture and clean up indenting. Signed-off-by: Helge Deller <deller@gmx.de>
Diffstat (limited to 'arch/parisc/lib')
-rw-r--r--arch/parisc/lib/memcpy.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/arch/parisc/lib/memcpy.c b/arch/parisc/lib/memcpy.c
index b2b441b32341..f82ff10ed974 100644
--- a/arch/parisc/lib/memcpy.c
+++ b/arch/parisc/lib/memcpy.c
@@ -489,20 +489,23 @@ static unsigned long pa_memcpy(void *dstp, const void *srcp, unsigned long len)
}
#ifdef __KERNEL__
-unsigned long copy_to_user(void __user *dst, const void *src, unsigned long len)
+unsigned long __copy_to_user(void __user *dst, const void *src,
+ unsigned long len)
{
mtsp(get_kernel_space(), 1);
mtsp(get_user_space(), 2);
return pa_memcpy((void __force *)dst, src, len);
}
+EXPORT_SYMBOL(__copy_to_user);
-EXPORT_SYMBOL(__copy_from_user);
-unsigned long __copy_from_user(void *dst, const void __user *src, unsigned long len)
+unsigned long __copy_from_user(void *dst, const void __user *src,
+ unsigned long len)
{
mtsp(get_user_space(), 1);
mtsp(get_kernel_space(), 2);
return pa_memcpy(dst, (void __force *)src, len);
}
+EXPORT_SYMBOL(__copy_from_user);
unsigned long copy_in_user(void __user *dst, const void __user *src, unsigned long len)
{
@@ -520,8 +523,6 @@ void * memcpy(void * dst,const void *src, size_t count)
return dst;
}
-EXPORT_SYMBOL(copy_to_user);
-EXPORT_SYMBOL(copy_from_user);
EXPORT_SYMBOL(copy_in_user);
EXPORT_SYMBOL(memcpy);