projects
/
firefly-linux-kernel-4.4.55.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
dd23e60
)
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
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Sat, 24 Sep 2016 08:07:44 +0000
(10:07 +0200)
commit
6e050503a150b2126620c1a1e9b3a368fcd51eac
upstream.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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 a49635c512665ddc6b9e70e5d944c57e26d349d6..92ade79ac4272ea22657b3aac6adfb90b1d4105f 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;
}