sparc32: fix copy_from_user()
authorAl Viro <viro@zeniv.linux.org.uk>
Mon, 22 Aug 2016 04:23:07 +0000 (00:23 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Tue, 13 Sep 2016 21:50:15 +0000 (17:50 -0400)
Cc: stable@vger.kernel.org
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
arch/sparc/include/asm/uaccess_32.h

index 341a5a133f4837b98f5c9928865ccf6d088af419..035c89b7df5d81208299fbf19b6d6deaae1e9baf 100644 (file)
@@ -269,8 +269,10 @@ static inline unsigned long copy_from_user(void *to, const void __user *from, un
                if (!__builtin_constant_p(n))
                        check_object_size(to, n, false);
                return __copy_user((__force void __user *) to, from, n);
-       } else
+       } else {
+               memset(to, 0, n);
                return n;
+       }
 }
 
 static inline unsigned long __copy_from_user(void *to, const void __user *from, unsigned long n)