amd64: get rid of zeroing

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
此提交包含在:
Al Viro
2017-03-25 18:36:22 -04:00
父節點 d597580d37
當前提交 122b05ddf5
共有 4 個檔案被更改,包括 25 行新增16 行删除

查看文件

@@ -76,10 +76,11 @@ EXPORT_SYMBOL(_copy_to_user);
*/
unsigned long _copy_from_user(void *to, const void __user *from, unsigned n)
{
unsigned long res = n;
if (access_ok(VERIFY_READ, from, n))
n = __copy_from_user(to, from, n);
else
memset(to, 0, n);
return n;
res = __copy_from_user_inatomic(to, from, n);
if (unlikely(res))
memset(to + n - res, 0, res);
return res;
}
EXPORT_SYMBOL(_copy_from_user);

查看文件

@@ -80,9 +80,5 @@ copy_user_handle_tail(char *to, char *from, unsigned len)
break;
}
clac();
/* If the destination is a kernel buffer, we always clear the end */
if (!__addr_ok(to))
memset(to, 0, len);
return len;
}