Merge branch 'work.uaccess' into for-linus

This commit is contained in:
Al Viro
2016-10-14 20:42:44 -04:00
کامیت 2692a71bbd
9فایلهای تغییر یافته به همراه47 افزوده شده و 78 حذف شده

مشاهده پرونده

@@ -533,11 +533,12 @@ __clear_user(void __user *addr, unsigned long n)
static inline unsigned long __must_check copy_from_user(void *to, const void __user *from, unsigned long n)
{
if (access_ok(VERIFY_READ, from, n))
n = __copy_from_user(to, from, n);
else /* security hole - plug it */
memset(to, 0, n);
return n;
unsigned long res = n;
if (likely(access_ok(VERIFY_READ, from, n)))
res = __copy_from_user(to, from, n);
if (unlikely(res))
memset(to + (n - res), 0, res);
return res;
}
static inline unsigned long __must_check copy_to_user(void __user *to, const void *from, unsigned long n)