summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorWANG Cong <xiyou.wangcong@gmail.com>2008-05-08 15:52:33 +0200
committerAl Viro <viro@zeniv.linux.org.uk>2008-05-16 23:23:11 +0200
commit23c4971e3d97de4e1b7961ca6eacee35aa15ce5f (patch)
tree5bf0df37e7232b5a867074242645a98a217688f0 /fs
parent[PATCH] get rid of leak in compat_execve() (diff)
downloadlinux-23c4971e3d97de4e1b7961ca6eacee35aa15ce5f.tar.xz
linux-23c4971e3d97de4e1b7961ca6eacee35aa15ce5f.zip
[Patch] fs/binfmt_elf.c: fix wrong return values
create_elf_tables() returns 0 on success. But when strnlen_user() "fails", it returns 0 directly. So this is wrong. Signed-off-by: WANG Cong <wangcong@zeuux.org> Cc: Alexander Viro <viro@zeniv.linux.org.uk> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r--fs/binfmt_elf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index bd08332079cf..0fa95b198e6e 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -256,7 +256,7 @@ create_elf_tables(struct linux_binprm *bprm, struct elfhdr *exec,
return -EFAULT;
len = strnlen_user((void __user *)p, MAX_ARG_STRLEN);
if (!len || len > MAX_ARG_STRLEN)
- return 0;
+ return -EINVAL;
p += len;
}
if (__put_user(0, argv))
@@ -268,7 +268,7 @@ create_elf_tables(struct linux_binprm *bprm, struct elfhdr *exec,
return -EFAULT;
len = strnlen_user((void __user *)p, MAX_ARG_STRLEN);
if (!len || len > MAX_ARG_STRLEN)
- return 0;
+ return -EINVAL;
p += len;
}
if (__put_user(0, envp))