diff options
author | Ingo Molnar <mingo@elte.hu> | 2010-09-21 13:56:43 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-09-21 13:56:49 +0200 |
commit | cf84fd96323633be7d437e1de4505fc82ff2c11a (patch) | |
tree | 094b7a7421945c9ea244f3605378065935f1c100 /fs/exec.c | |
parent | 31915ab4cbf507aadab40847cf9989da5e88b090 (diff) | |
parent | b30a3f6257ed2105259b404d419b4964e363928c (diff) |
Merge commit 'v2.6.36-rc5' into sched/core
Merge reason: Pick up the latest fixes in -rc5.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'fs/exec.c')
-rw-r--r-- | fs/exec.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/fs/exec.c b/fs/exec.c index 2d945528274..828dd2461d6 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -376,6 +376,9 @@ static int count(const char __user * const __user * argv, int max) argv++; if (i++ >= max) return -E2BIG; + + if (fatal_signal_pending(current)) + return -ERESTARTNOHAND; cond_resched(); } } @@ -419,6 +422,12 @@ static int copy_strings(int argc, const char __user *const __user *argv, while (len > 0) { int offset, bytes_to_copy; + if (fatal_signal_pending(current)) { + ret = -ERESTARTNOHAND; + goto out; + } + cond_resched(); + offset = pos % PAGE_SIZE; if (offset == 0) offset = PAGE_SIZE; @@ -594,6 +603,11 @@ int setup_arg_pages(struct linux_binprm *bprm, #else stack_top = arch_align_stack(stack_top); stack_top = PAGE_ALIGN(stack_top); + + if (unlikely(stack_top < mmap_min_addr) || + unlikely(vma->vm_end - vma->vm_start >= stack_top - mmap_min_addr)) + return -ENOMEM; + stack_shift = vma->vm_end - stack_top; bprm->p -= stack_shift; |