]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
metag: copy_from_user() should zero the destination on access_ok() failure
authorAl Viro <viro@zeniv.linux.org.uk>
Fri, 19 Aug 2016 02:08:20 +0000 (22:08 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Tue, 13 Sep 2016 21:49:40 +0000 (17:49 -0400)
Cc: stable@vger.kernel.org
Acked-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
arch/metag/include/asm/uaccess.h

index 8282cbce7e399a84488e675af0751341d24f0205..273e61225c277ae67ba28dfae4ef9123e3ef34a9 100644 (file)
@@ -204,8 +204,9 @@ extern unsigned long __must_check __copy_user_zeroing(void *to,
 static inline unsigned long
 copy_from_user(void *to, const void __user *from, unsigned long n)
 {
-       if (access_ok(VERIFY_READ, from, n))
+       if (likely(access_ok(VERIFY_READ, from, n)))
                return __copy_user_zeroing(to, from, n);
+       memset(to, 0, n);
        return n;
 }