1 --- exec-shield-nx-2.6.7-A0.org 2004-06-27 03:39:46.397788416 +0200
2 +++ exec-shield-nx-2.6.7-A0 2004-06-27 03:44:09.132846616 +0200
4 #include <linux/percpu.h>
8 +extern int exec_shield;
9 +extern int exec_shield_randomize;
10 +extern int print_fatal_signals;
14 @@ -194,6 +197,8 @@ struct mm_struct {
16 struct vm_area_struct * mmap_cache; /* last find_vma result */
17 @@ -2168,23 +2168,23 @@
19 * vma is the first one with address > vma->vm_end. Have to extend vma.
20 @@ -1210,7 +1224,7 @@ int expand_stack(struct vm_area_struct *
24 + if (vma->vm_flags & VM_LOCKED)
25 + gr_learn_resource(current, RLIMIT_MEMLOCK, (vma->vm_mm->locked_vm + grow) << PAGE_SHIFT, 1);
27 - if (address - vma->vm_start > current->rlim[RLIMIT_STACK].rlim_cur ||
28 + if (over_stack_limit(address - vma->vm_start) ||
29 ((vma->vm_mm->total_vm + grow) << PAGE_SHIFT) >
30 - current->rlim[RLIMIT_AS].rlim_cur) {
31 - anon_vma_unlock(vma);
32 + current->rlim[RLIMIT_AS].rlim_cur ||
33 + ((vma->vm_flags & VM_LOCKED) &&
34 @@ -1271,7 +1285,7 @@ int expand_stack(struct vm_area_struct *
38 + if (vma->vm_flags & VM_LOCKED)
39 + gr_learn_resource(current, RLIMIT_MEMLOCK, (vma->vm_mm->locked_vm + grow) << PAGE_SHIFT, 1);
41 - if (vma->vm_end - address > current->rlim[RLIMIT_STACK].rlim_cur ||
42 + if (over_stack_limit(vma->vm_end - address) ||
43 ((vma->vm_mm->total_vm + grow) << PAGE_SHIFT) >
44 - current->rlim[RLIMIT_AS].rlim_cur) {
45 - anon_vma_unlock(vma);
46 + current->rlim[RLIMIT_AS].rlim_cur ||
47 + ((vma->vm_flags & VM_LOCKED) &&
48 @@ -1384,6 +1398,7 @@ no_mmaps:
49 static void unmap_vma(struct mm_struct *mm, struct vm_area_struct *area)