Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 72452 | Differences between
and this patch

Collapse All | Expand All

(-)linux-2.6.7-gentoo-r19/arch/ia64/ia32/binfmt_elf32.c (-5 / +17 lines)
Lines 82-88 ia64_elf32_init (struct pt_regs *regs) Link Here
82
		vma->vm_ops = &ia32_shared_page_vm_ops;
82
		vma->vm_ops = &ia32_shared_page_vm_ops;
83
		down_write(&current->mm->mmap_sem);
83
		down_write(&current->mm->mmap_sem);
84
		{
84
		{
85
			insert_vm_struct(current->mm, vma);
85
			if (insert_vm_struct(current->mm, vma)) {
86
				kmem_cache_free(vm_area_cachep, vma);
87
				up_write(&current->mm->mmap_sem);
88
				return;
89
			}
86
		}
90
		}
87
		up_write(&current->mm->mmap_sem);
91
		up_write(&current->mm->mmap_sem);
88
	}
92
	}
Lines 101-107 ia64_elf32_init (struct pt_regs *regs) Link Here
101
		vma->vm_flags = VM_READ|VM_WRITE|VM_MAYREAD|VM_MAYWRITE;
105
		vma->vm_flags = VM_READ|VM_WRITE|VM_MAYREAD|VM_MAYWRITE;
102
		down_write(&current->mm->mmap_sem);
106
		down_write(&current->mm->mmap_sem);
103
		{
107
		{
104
			insert_vm_struct(current->mm, vma);
108
			if (insert_vm_struct(current->mm, vma)) {
109
				kmem_cache_free(vm_area_cachep, vma);
110
				up_write(&current->mm->mmap_sem);
111
				return;
112
			}
105
		}
113
		}
106
		up_write(&current->mm->mmap_sem);
114
		up_write(&current->mm->mmap_sem);
107
	}
115
	}
Lines 149-155 ia32_setup_arg_pages (struct linux_binpr Link Here
149
	unsigned long stack_base;
157
	unsigned long stack_base;
150
	struct vm_area_struct *mpnt;
158
	struct vm_area_struct *mpnt;
151
	struct mm_struct *mm = current->mm;
159
	struct mm_struct *mm = current->mm;
152
	int i;
160
	int i, ret;
153
161
154
	stack_base = IA32_STACK_TOP - MAX_ARG_PAGES*PAGE_SIZE;
162
	stack_base = IA32_STACK_TOP - MAX_ARG_PAGES*PAGE_SIZE;
155
	mm->arg_start = bprm->p + stack_base;
163
	mm->arg_start = bprm->p + stack_base;
Lines 182-189 ia32_setup_arg_pages (struct linux_binpr Link Here
182
		else
190
		else
183
			mpnt->vm_flags = VM_STACK_FLAGS;
191
			mpnt->vm_flags = VM_STACK_FLAGS;
184
		mpnt->vm_page_prot = (mpnt->vm_flags & VM_EXEC)?
192
		mpnt->vm_page_prot = (mpnt->vm_flags & VM_EXEC)?
185
					PAGE_COPY_EXEC: PAGE_COPY;
193
			PAGE_COPY_EXEC: PAGE_COPY;
186
		insert_vm_struct(current->mm, mpnt);
194
		if ((ret = insert_vm_struct(current->mm, mpnt))) {
195
			up_write(&current->mm->mmap_sem);
196
			kmem_cache_free(vm_area_cachep, mpnt);
197
			return ret;
198
		}
187
		current->mm->total_vm = (mpnt->vm_end - mpnt->vm_start) >> PAGE_SHIFT;
199
		current->mm->total_vm = (mpnt->vm_end - mpnt->vm_start) >> PAGE_SHIFT;
188
	}
200
	}
189
201
(-)linux-2.6.7-gentoo-r19/arch/ia64/mm/init.c (-2 / +14 lines)
Lines 129-135 ia64_init_addr_space (void) Link Here
129
		vma->vm_end = vma->vm_start + PAGE_SIZE;
129
		vma->vm_end = vma->vm_start + PAGE_SIZE;
130
		vma->vm_page_prot = protection_map[VM_DATA_DEFAULT_FLAGS & 0x7];
130
		vma->vm_page_prot = protection_map[VM_DATA_DEFAULT_FLAGS & 0x7];
131
		vma->vm_flags = VM_READ|VM_WRITE|VM_MAYREAD|VM_MAYWRITE|VM_GROWSUP;
131
		vma->vm_flags = VM_READ|VM_WRITE|VM_MAYREAD|VM_MAYWRITE|VM_GROWSUP;
132
		insert_vm_struct(current->mm, vma);
132
		down_write(&current->mm->mmap_sem);
133
		if (insert_vm_struct(current->mm, vma)) {
134
			up_write(&current->mm->mmap_sem);
135
			kmem_cache_free(vm_area_cachep, vma);
136
			return;
137
		}
138
		up_write(&current->mm->mmap_sem);
133
	}
139
	}
134
140
135
	/* map NaT-page at address zero to speed up speculative dereferencing of NULL: */
141
	/* map NaT-page at address zero to speed up speculative dereferencing of NULL: */
Lines 141-147 ia64_init_addr_space (void) Link Here
141
			vma->vm_end = PAGE_SIZE;
147
			vma->vm_end = PAGE_SIZE;
142
			vma->vm_page_prot = __pgprot(pgprot_val(PAGE_READONLY) | _PAGE_MA_NAT);
148
			vma->vm_page_prot = __pgprot(pgprot_val(PAGE_READONLY) | _PAGE_MA_NAT);
143
			vma->vm_flags = VM_READ | VM_MAYREAD | VM_IO | VM_RESERVED;
149
			vma->vm_flags = VM_READ | VM_MAYREAD | VM_IO | VM_RESERVED;
144
			insert_vm_struct(current->mm, vma);
150
			down_write(&current->mm->mmap_sem);
151
			if (insert_vm_struct(current->mm, vma)) {
152
				up_write(&current->mm->mmap_sem);
153
				kmem_cache_free(vm_area_cachep, vma);
154
				return;
155
			}
156
			up_write(&current->mm->mmap_sem);
145
		}
157
		}
146
	}
158
	}
147
}
159
}
(-)linux-2.6.7-gentoo-r19/arch/s390/kernel/compat_exec.c (-2 / +6 lines)
Lines 39-45 int setup_arg_pages32(struct linux_binpr Link Here
39
	unsigned long stack_base;
39
	unsigned long stack_base;
40
	struct vm_area_struct *mpnt;
40
	struct vm_area_struct *mpnt;
41
	struct mm_struct *mm = current->mm;
41
	struct mm_struct *mm = current->mm;
42
	int i;
42
	int i, ret;
43
43
44
	stack_base = STACK_TOP - MAX_ARG_PAGES*PAGE_SIZE;
44
	stack_base = STACK_TOP - MAX_ARG_PAGES*PAGE_SIZE;
45
	mm->arg_start = bprm->p + stack_base;
45
	mm->arg_start = bprm->p + stack_base;
Lines 68-74 int setup_arg_pages32(struct linux_binpr Link Here
68
		/* executable stack setting would be applied here */
68
		/* executable stack setting would be applied here */
69
		mpnt->vm_page_prot = PAGE_COPY;
69
		mpnt->vm_page_prot = PAGE_COPY;
70
		mpnt->vm_flags = VM_STACK_FLAGS;
70
		mpnt->vm_flags = VM_STACK_FLAGS;
71
		insert_vm_struct(mm, mpnt);
71
		if ((ret = insert_vm_struct(mm, mpnt))) {
72
			up_write(&mm->mmap_sem);
73
			kmem_cache_free(vm_area_cachep, mpnt);
74
			return ret;
75
		}
72
		mm->total_vm = (mpnt->vm_end - mpnt->vm_start) >> PAGE_SHIFT;
76
		mm->total_vm = (mpnt->vm_end - mpnt->vm_start) >> PAGE_SHIFT;
73
	} 
77
	} 
74
78
(-)linux-2.6.7-gentoo-r19/arch/x86_64/ia32/ia32_binfmt.c (-2 / +6 lines)
Lines 330-336 int setup_arg_pages(struct linux_binprm Link Here
330
	unsigned long stack_base;
330
	unsigned long stack_base;
331
	struct vm_area_struct *mpnt;
331
	struct vm_area_struct *mpnt;
332
	struct mm_struct *mm = current->mm;
332
	struct mm_struct *mm = current->mm;
333
	int i;
333
	int i, ret;
334
334
335
	stack_base = IA32_STACK_TOP - MAX_ARG_PAGES * PAGE_SIZE;
335
	stack_base = IA32_STACK_TOP - MAX_ARG_PAGES * PAGE_SIZE;
336
	mm->arg_start = bprm->p + stack_base;
336
	mm->arg_start = bprm->p + stack_base;
Lines 364-370 int setup_arg_pages(struct linux_binprm Link Here
364
			mpnt->vm_flags = vm_stack_flags32;
364
			mpnt->vm_flags = vm_stack_flags32;
365
 		mpnt->vm_page_prot = (mpnt->vm_flags & VM_EXEC) ? 
365
 		mpnt->vm_page_prot = (mpnt->vm_flags & VM_EXEC) ? 
366
 			PAGE_COPY_EXEC : PAGE_COPY;
366
 			PAGE_COPY_EXEC : PAGE_COPY;
367
		insert_vm_struct(mm, mpnt);
367
		if ((ret = insert_vm_struct(mm, mpnt))) {
368
			up_write(&mm->mmap_sem);
369
			kmem_cache_free(vm_area_cachep, mpnt);
370
			return ret;
371
		}
368
		mm->total_vm = (mpnt->vm_end - mpnt->vm_start) >> PAGE_SHIFT;
372
		mm->total_vm = (mpnt->vm_end - mpnt->vm_start) >> PAGE_SHIFT;
369
	} 
373
	} 
370
374
(-)linux-2.6.7-gentoo-r19/fs/exec.c (-2 / +1 lines)
Lines 342-348 int setup_arg_pages(struct linux_binprm Link Here
342
	unsigned long stack_base;
342
	unsigned long stack_base;
343
	struct vm_area_struct *mpnt;
343
	struct vm_area_struct *mpnt;
344
	struct mm_struct *mm = current->mm;
344
	struct mm_struct *mm = current->mm;
345
	int i;
345
	int i, ret;
346
	long arg_size;
346
	long arg_size;
347
347
348
#ifdef CONFIG_STACK_GROWSUP
348
#ifdef CONFIG_STACK_GROWSUP
Lines 413-419 int setup_arg_pages(struct linux_binprm Link Here
413
413
414
	down_write(&mm->mmap_sem);
414
	down_write(&mm->mmap_sem);
415
	{
415
	{
416
		struct vm_area_struct *vma;
417
		mpnt->vm_mm = mm;
416
		mpnt->vm_mm = mm;
418
#ifdef CONFIG_STACK_GROWSUP
417
#ifdef CONFIG_STACK_GROWSUP
419
		mpnt->vm_start = stack_base;
418
		mpnt->vm_start = stack_base;
(-)linux-2.6.7-gentoo-r19/include/linux/mm.h (-1 / +1 lines)
Lines 623-629 extern struct vm_area_struct *vma_merge( Link Here
623
extern struct anon_vma *find_mergeable_anon_vma(struct vm_area_struct *);
623
extern struct anon_vma *find_mergeable_anon_vma(struct vm_area_struct *);
624
extern int split_vma(struct mm_struct *,
624
extern int split_vma(struct mm_struct *,
625
	struct vm_area_struct *, unsigned long addr, int new_below);
625
	struct vm_area_struct *, unsigned long addr, int new_below);
626
extern void insert_vm_struct(struct mm_struct *, struct vm_area_struct *);
626
extern int insert_vm_struct(struct mm_struct *, struct vm_area_struct *);
627
extern void __vma_link_rb(struct mm_struct *, struct vm_area_struct *,
627
extern void __vma_link_rb(struct mm_struct *, struct vm_area_struct *,
628
	struct rb_node **, struct rb_node *);
628
	struct rb_node **, struct rb_node *);
629
extern struct vm_area_struct *copy_vma(struct vm_area_struct **,
629
extern struct vm_area_struct *copy_vma(struct vm_area_struct **,
(-)linux-2.6.7-gentoo-r19/mm/mmap.c (-2 / +3 lines)
Lines 1722-1728 void exit_mmap(struct mm_struct *mm) Link Here
1722
 * and into the inode's i_mmap tree.  If vm_file is non-NULL
1722
 * and into the inode's i_mmap tree.  If vm_file is non-NULL
1723
 * then i_mmap_lock is taken here.
1723
 * then i_mmap_lock is taken here.
1724
 */
1724
 */
1725
void insert_vm_struct(struct mm_struct * mm, struct vm_area_struct * vma)
1725
int insert_vm_struct(struct mm_struct * mm, struct vm_area_struct * vma)
1726
{
1726
{
1727
	struct vm_area_struct * __vma, * prev;
1727
	struct vm_area_struct * __vma, * prev;
1728
	struct rb_node ** rb_link, * rb_parent;
1728
	struct rb_node ** rb_link, * rb_parent;
Lines 1745-1752 void insert_vm_struct(struct mm_struct * Link Here
1745
	}
1745
	}
1746
	__vma = find_vma_prepare(mm,vma->vm_start,&prev,&rb_link,&rb_parent);
1746
	__vma = find_vma_prepare(mm,vma->vm_start,&prev,&rb_link,&rb_parent);
1747
	if (__vma && __vma->vm_start < vma->vm_end)
1747
	if (__vma && __vma->vm_start < vma->vm_end)
1748
		BUG();
1748
		return -ENOMEM;
1749
	vma_link(mm, vma, prev, rb_link, rb_parent);
1749
	vma_link(mm, vma, prev, rb_link, rb_parent);
1750
	return 0;
1750
}
1751
}
1751
1752
1752
/*
1753
/*

Return to bug 72452