diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2016-08-22 00:23:07 -0400 |
---|---|---|
committer | Sasha Levin <alexander.levin@verizon.com> | 2016-10-05 22:40:20 -0400 |
commit | 9050993a5a2aff7b9088c7b10a673a210cfa463f (patch) | |
tree | 55c2da78e4dcb799e404b7b22c39d08adeb5d6a1 | |
parent | 8bd2ef709d42a7c839c4ebf7c91f4dec2c90b6f6 (diff) | |
download | lwn-9050993a5a2aff7b9088c7b10a673a210cfa463f.tar.gz lwn-9050993a5a2aff7b9088c7b10a673a210cfa463f.zip |
sparc32: fix copy_from_user()
[ Upstream commit 917400cecb4b52b5cde5417348322bb9c8272fa6 ]
Cc: stable@vger.kernel.org
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
-rw-r--r-- | arch/sparc/include/asm/uaccess_32.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/sparc/include/asm/uaccess_32.h b/arch/sparc/include/asm/uaccess_32.h index 9634d086fc56..79b03872e165 100644 --- a/arch/sparc/include/asm/uaccess_32.h +++ b/arch/sparc/include/asm/uaccess_32.h @@ -265,8 +265,10 @@ static inline unsigned long copy_from_user(void *to, const void __user *from, un { if (n && __access_ok((unsigned long) from, n)) return __copy_user((__force void __user *) to, from, n); - else + else { + memset(to, 0, n); return n; + } } static inline unsigned long __copy_from_user(void *to, const void __user *from, unsigned long n) |