]> 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)
committerBen Hutchings <ben@decadent.org.uk>
Sun, 20 Nov 2016 01:17:28 +0000 (01:17 +0000)
commit e69d700535ac43a18032b3c399c69bf4639e89a2 upstream.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
arch/mips/include/asm/uaccess.h

index 16e0ea6b99d8e88c3cdd73e60005281c69bf0a71..cb4a3ee31983fe117b5b7a2d9f39a27ff64d790a 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>
 
 /*
@@ -1139,6 +1140,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;                                                       \