summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2016-08-20 16:18:53 -0400
committerSasha Levin <alexander.levin@verizon.com>2016-10-05 22:40:20 -0400
commitc99e37cddc0bdc9e108d0c7e2287248711268fdf (patch)
tree48f493b0ba8c85a0aac9428a0763612037ffc6f6 /arch
parent09baa6b1ba17ac7168ad16daeb0f114dfac1cedc (diff)
downloadlwn-c99e37cddc0bdc9e108d0c7e2287248711268fdf.tar.gz
lwn-c99e37cddc0bdc9e108d0c7e2287248711268fdf.zip
mips: copy_from_user() must zero the destination on access_ok() failure
[ Upstream commit e69d700535ac43a18032b3c399c69bf4639e89a2 ] Cc: stable@vger.kernel.org Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/mips/include/asm/uaccess.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/mips/include/asm/uaccess.h b/arch/mips/include/asm/uaccess.h
index 22a5624e2fd2..953a75a8a8d2 100644
--- a/arch/mips/include/asm/uaccess.h
+++ b/arch/mips/include/asm/uaccess.h
@@ -14,6 +14,7 @@
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/thread_info.h>
+#include <linux/string.h>
#include <asm/asm-eva.h>
/*
@@ -1136,6 +1137,8 @@ extern size_t __copy_in_user_eva(void *__to, const void *__from, size_t __n);
__cu_len = __invoke_copy_from_user(__cu_to, \
__cu_from, \
__cu_len); \
+ } else { \
+ memset(__cu_to, 0, __cu_len); \
} \
} \
__cu_len; \