projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c685238
)
sh: fix copy_from_user()
author
Al Viro
<viro@zeniv.linux.org.uk>
Mon, 22 Aug 2016 03:39:47 +0000
(23:39 -0400)
committer
Al Viro
<viro@zeniv.linux.org.uk>
Tue, 13 Sep 2016 21:50:15 +0000
(17:50 -0400)
Cc: stable@vger.kernel.org
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
arch/sh/include/asm/uaccess.h
patch
|
blob
|
history
diff --git
a/arch/sh/include/asm/uaccess.h
b/arch/sh/include/asm/uaccess.h
index
a49635c
..
92ade79
100644
(file)
--- a/
arch/sh/include/asm/uaccess.h
+++ b/
arch/sh/include/asm/uaccess.h
@@
-151,7
+151,10
@@
copy_from_user(void *to, const void __user *from, unsigned long n)
__kernel_size_t __copy_size = (__kernel_size_t) n;
if (__copy_size && __access_ok(__copy_from, __copy_size))
- return __copy_user(to, from, __copy_size);
+ __copy_size = __copy_user(to, from, __copy_size);
+
+ if (unlikely(__copy_size))
+ memset(to + (n - __copy_size), 0, __copy_size);
return __copy_size;
}