projects
/
cascardo
/
linux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
perf: Find task before event alloc
[cascardo/linux.git]
/
fs
/
exec.c
diff --git
a/fs/exec.c
b/fs/exec.c
index
2d94552
..
828dd24
100644
(file)
--- 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;
argv++;
if (i++ >= max)
return -E2BIG;
+
+ if (fatal_signal_pending(current))
+ return -ERESTARTNOHAND;
cond_resched();
}
}
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;
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;
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);
#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;
stack_shift = vma->vm_end - stack_top;
bprm->p -= stack_shift;