]> 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)
committerJiri Slaby <jslaby@suse.cz>
Thu, 29 Sep 2016 09:14:34 +0000 (11:14 +0200)
commit e69d700535ac43a18032b3c399c69bf4639e89a2 upstream.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
arch/mips/include/asm/uaccess.h

index f3fa3750f577c2414396943871a8f0bd6df6b928..e09339df223244e506c36dd83f16d40a109b0b12 100644 (file)
@@ -13,6 +13,7 @@
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/thread_info.h>
+#include <linux/string.h>
 
 /*
  * The fs value determines whether argument validity checking should be
@@ -938,6 +939,8 @@ extern size_t __copy_user_inatomic(void *__to, const void *__from, size_t __n);
                might_fault();                                          \
                __cu_len = __invoke_copy_from_user(__cu_to, __cu_from,  \
                                                   __cu_len);           \
+       } else {                                                        \
+               memset(__cu_to, 0, __cu_len);                           \
        }                                                               \
        __cu_len;                                                       \
 })