]> git.hungrycats.org Git - linux/commitdiff
mips: copy_from_user() must zero the destination on access_ok() failure
authorAl Viro <viro@zeniv.linux.org.uk>
Sat, 20 Aug 2016 20:18:53 +0000 (16:18 -0400)
committerSasha Levin <alexander.levin@verizon.com>
Mon, 3 Oct 2016 01:13:35 +0000 (21:13 -0400)
[ 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>
arch/mips/include/asm/uaccess.h

index bf8b32450ef6b4b5c91993f52fa205e79d2e9226..bc2f5164ce51f89b6c59a270ea8007af08ca91f5 100644 (file)
@@ -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;                                                       \