Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 42801
b: refs/heads/master
c: 841d5fb
h: refs/heads/master
i:
  42799: 017aeb3
v: v3
  • Loading branch information
Heiko Carstens authored and Linus Torvalds committed Dec 7, 2006
1 parent d53707d commit fc75be2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fec1d0115240593b39898289e6e1413ea6e44a84
refs/heads/master: 841d5fb7c75260f76ae682648b28a3dca724940d
11 changes: 7 additions & 4 deletions trunk/fs/binfmt_elf.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,9 @@ create_elf_tables(struct linux_binprm *bprm, struct elfhdr *exec,
if (interp_aout) {
argv = sp + 2;
envp = argv + argc + 1;
__put_user((elf_addr_t)(unsigned long)argv, sp++);
__put_user((elf_addr_t)(unsigned long)envp, sp++);
if (__put_user((elf_addr_t)(unsigned long)argv, sp++) ||
__put_user((elf_addr_t)(unsigned long)envp, sp++))
return -EFAULT;
} else {
argv = sp;
envp = argv + argc + 1;
Expand All @@ -254,7 +255,8 @@ create_elf_tables(struct linux_binprm *bprm, struct elfhdr *exec,
p = current->mm->arg_end = current->mm->arg_start;
while (argc-- > 0) {
size_t len;
__put_user((elf_addr_t)p, argv++);
if (__put_user((elf_addr_t)p, argv++))
return -EFAULT;
len = strnlen_user((void __user *)p, PAGE_SIZE*MAX_ARG_PAGES);
if (!len || len > PAGE_SIZE*MAX_ARG_PAGES)
return 0;
Expand All @@ -265,7 +267,8 @@ create_elf_tables(struct linux_binprm *bprm, struct elfhdr *exec,
current->mm->arg_end = current->mm->env_start = p;
while (envc-- > 0) {
size_t len;
__put_user((elf_addr_t)p, envp++);
if (__put_user((elf_addr_t)p, envp++))
return -EFAULT;
len = strnlen_user((void __user *)p, PAGE_SIZE*MAX_ARG_PAGES);
if (!len || len > PAGE_SIZE*MAX_ARG_PAGES)
return 0;
Expand Down

0 comments on commit fc75be2

Please sign in to comment.