diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-05-29 10:05:05 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-05-29 10:05:05 -0400 |
commit | 6715930654e06c4d2e66e718ea159079f71838f4 (patch) | |
tree | 6a0a19fb62f3e99cb5f6bf6c34ae541f7c30fb42 /fs/binfmt_elf.c | |
parent | ea3f01f8afd3bc5daff915cc4ea5cc5ea9e7d427 (diff) | |
parent | e490517a039a99d692cb3a5561941b0a5f576172 (diff) |
Merge commit 'linus/master' into sched-fixes-for-linus
Diffstat (limited to 'fs/binfmt_elf.c')
-rw-r--r-- | fs/binfmt_elf.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index b25707fee2cc..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, | |||
256 | return -EFAULT; | 256 | return -EFAULT; |
257 | len = strnlen_user((void __user *)p, MAX_ARG_STRLEN); | 257 | len = strnlen_user((void __user *)p, MAX_ARG_STRLEN); |
258 | if (!len || len > MAX_ARG_STRLEN) | 258 | if (!len || len > MAX_ARG_STRLEN) |
259 | return 0; | 259 | return -EINVAL; |
260 | p += len; | 260 | p += len; |
261 | } | 261 | } |
262 | if (__put_user(0, argv)) | 262 | if (__put_user(0, argv)) |
@@ -268,7 +268,7 @@ create_elf_tables(struct linux_binprm *bprm, struct elfhdr *exec, | |||
268 | return -EFAULT; | 268 | return -EFAULT; |
269 | len = strnlen_user((void __user *)p, MAX_ARG_STRLEN); | 269 | len = strnlen_user((void __user *)p, MAX_ARG_STRLEN); |
270 | if (!len || len > MAX_ARG_STRLEN) | 270 | if (!len || len > MAX_ARG_STRLEN) |
271 | return 0; | 271 | return -EINVAL; |
272 | p += len; | 272 | p += len; |
273 | } | 273 | } |
274 | if (__put_user(0, envp)) | 274 | if (__put_user(0, envp)) |
@@ -1900,7 +1900,7 @@ static int elf_core_dump(long signr, struct pt_regs *regs, struct file *file, un | |||
1900 | /* alloc memory for large data structures: too large to be on stack */ | 1900 | /* alloc memory for large data structures: too large to be on stack */ |
1901 | elf = kmalloc(sizeof(*elf), GFP_KERNEL); | 1901 | elf = kmalloc(sizeof(*elf), GFP_KERNEL); |
1902 | if (!elf) | 1902 | if (!elf) |
1903 | goto cleanup; | 1903 | goto out; |
1904 | 1904 | ||
1905 | segs = current->mm->map_count; | 1905 | segs = current->mm->map_count; |
1906 | #ifdef ELF_CORE_EXTRA_PHDRS | 1906 | #ifdef ELF_CORE_EXTRA_PHDRS |
@@ -2034,8 +2034,9 @@ end_coredump: | |||
2034 | set_fs(fs); | 2034 | set_fs(fs); |
2035 | 2035 | ||
2036 | cleanup: | 2036 | cleanup: |
2037 | kfree(elf); | ||
2038 | free_note_info(&info); | 2037 | free_note_info(&info); |
2038 | kfree(elf); | ||
2039 | out: | ||
2039 | return has_dumped; | 2040 | return has_dumped; |
2040 | } | 2041 | } |
2041 | 2042 | ||