mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
metag: copy_from_user() should zero the destination on access_ok() failure
commit 8ae95ed4ae upstream.
Acked-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
0883ebba7a
commit
3123574405
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user