diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2016-08-20 16:18:53 -0400 |
---|---|---|
committer | Sasha Levin <alexander.levin@verizon.com> | 2016-10-02 21:13:35 -0400 |
commit | 34c464014beb4e351775ed91bbce11e3ecdf263c (patch) | |
tree | b17e5af931be8e97815f2c0c3bd3d07cbda86e1e | |
parent | 57dcb60fe8b2c22d860d381788698185eeb25ef2 (diff) | |
download | lwn-34c464014beb4e351775ed91bbce11e3ecdf263c.tar.gz lwn-34c464014beb4e351775ed91bbce11e3ecdf263c.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>
-rw-r--r-- | arch/mips/include/asm/uaccess.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/mips/include/asm/uaccess.h b/arch/mips/include/asm/uaccess.h index bf8b32450ef6..bc2f5164ce51 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; \ |