Commit 79a50a32 authored by Anton Blanchard's avatar Anton Blanchard

ppc64: memset destination if access_ok fails in copy_from_user

parent 801430d8
...@@ -273,6 +273,8 @@ copy_from_user(void *to, const void *from, unsigned long n) ...@@ -273,6 +273,8 @@ copy_from_user(void *to, const void *from, unsigned long n)
{ {
if (likely(access_ok(VERIFY_READ, from, n))) if (likely(access_ok(VERIFY_READ, from, n)))
n = __copy_from_user(to, from, n); n = __copy_from_user(to, from, n);
else
memset(to, 0, n);
return n; return n;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment