git.openpandora.org
/
pandora-kernel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
264a035
)
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
Ben Hutchings
<ben@decadent.org.uk>
Sun, 20 Nov 2016 01:01:40 +0000
(
01:01
+0000)
commit
6e050503a150b2126620c1a1e9b3a368fcd51eac
upstream.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Ben Hutchings <ben@decadent.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
075848f
..
0e79711
100644
(file)
--- a/
arch/sh/include/asm/uaccess.h
+++ b/
arch/sh/include/asm/uaccess.h
@@
-175,7
+175,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;
}