diff options
| author | Dave Airlie <airlied@redhat.com> | 2010-09-24 15:37:33 +1000 |
|---|---|---|
| committer | Dave Airlie <airlied@redhat.com> | 2010-09-24 15:37:33 +1000 |
| commit | 4a445f291ac3faa08f56eaeb6e44856b6b72b74c (patch) | |
| tree | b66cc93311dc4c623113a87aa9b40730a21ac18e /fs/exec.c | |
| parent | cbc60ca04b342a4e1f2a1086a7277c077f07dbed (diff) | |
| parent | a850ea30374ebed32a0724742601861853fde869 (diff) | |
Merge remote branch 'origin/master' of /home/airlied/kernel//linux-2.6 into drm-core-next
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 2d9455282744..828dd2461d6b 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; |
