projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3b8767a
)
hexagon: fix strncpy_from_user() error return
author
Al Viro
<viro@zeniv.linux.org.uk>
Fri, 19 Aug 2016 01:16:49 +0000
(21:16 -0400)
committer
Al Viro
<viro@zeniv.linux.org.uk>
Tue, 13 Sep 2016 21:49:39 +0000
(17:49 -0400)
It's -EFAULT, not -1 (and contrary to the comment in there,
__strnlen_user() can return 0 - on faults).
Cc: stable@vger.kernel.org
Acked-by: Richard Kuo <rkuo@codeaurora.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
arch/hexagon/include/asm/uaccess.h
patch
|
blob
|
history
diff --git
a/arch/hexagon/include/asm/uaccess.h
b/arch/hexagon/include/asm/uaccess.h
index f000a382bc7f62f28dfe980ab184904c70681914..f61cfb28e9f283800f968c2953705851da429e68 100644
(file)
--- a/
arch/hexagon/include/asm/uaccess.h
+++ b/
arch/hexagon/include/asm/uaccess.h
@@
-103,7
+103,8
@@
static inline long hexagon_strncpy_from_user(char *dst, const char __user *src,
{
long res = __strnlen_user(src, n);
- /* return from strnlen can't be zero -- that would be rubbish. */
+ if (unlikely(!res))
+ return -EFAULT;
if (res > n) {
copy_from_user(dst, src, n);