summaryrefslogtreecommitdiffstats
path: root/arch/avr32/include/asm/uaccess.h
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2016-09-09 19:28:23 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2016-09-13 17:50:18 -0400
commit8630c32275bac2de6ffb8aea9d9b11663e7ad28e (patch)
tree93800a44bb196d8eb11b2ae0d7d2a810dc0883dd /arch/avr32/include/asm/uaccess.h
parente98b9e37ae04562d52c96f46b3cf4c2e80222dc1 (diff)
downloadlinux-8630c32275bac2de6ffb8aea9d9b11663e7ad28e.tar.gz
linux-8630c32275bac2de6ffb8aea9d9b11663e7ad28e.tar.bz2
linux-8630c32275bac2de6ffb8aea9d9b11663e7ad28e.zip
avr32: fix copy_from_user()
really ugly, but apparently avr32 compilers turns access_ok() into something so bad that they want it in assembler. Left that way, zeroing added in inline wrapper. Cc: stable@vger.kernel.org Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/avr32/include/asm/uaccess.h')
-rw-r--r--arch/avr32/include/asm/uaccess.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/arch/avr32/include/asm/uaccess.h b/arch/avr32/include/asm/uaccess.h
index 68cf638faf48..b1ec1fa06463 100644
--- a/arch/avr32/include/asm/uaccess.h
+++ b/arch/avr32/include/asm/uaccess.h
@@ -74,7 +74,7 @@ extern __kernel_size_t __copy_user(void *to, const void *from,
extern __kernel_size_t copy_to_user(void __user *to, const void *from,
__kernel_size_t n);
-extern __kernel_size_t copy_from_user(void *to, const void __user *from,
+extern __kernel_size_t ___copy_from_user(void *to, const void __user *from,
__kernel_size_t n);
static inline __kernel_size_t __copy_to_user(void __user *to, const void *from,
@@ -88,6 +88,15 @@ static inline __kernel_size_t __copy_from_user(void *to,
{
return __copy_user(to, (const void __force *)from, n);
}
+static inline __kernel_size_t copy_from_user(void *to,
+ const void __user *from,
+ __kernel_size_t n)
+{
+ size_t res = ___copy_from_user(to, from, n);
+ if (unlikely(res))
+ memset(to + (n - res), 0, res);
+ return res;
+}
#define __copy_to_user_inatomic __copy_to_user
#define __copy_from_user_inatomic __copy_from_user