aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64/ia32/binfmt_elf32.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/ia64/ia32/binfmt_elf32.c')
-rw-r--r--arch/ia64/ia32/binfmt_elf32.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/arch/ia64/ia32/binfmt_elf32.c b/arch/ia64/ia32/binfmt_elf32.c
index 578737ec762..c05bda66236 100644
--- a/arch/ia64/ia32/binfmt_elf32.c
+++ b/arch/ia64/ia32/binfmt_elf32.c
@@ -91,9 +91,8 @@ ia64_elf32_init (struct pt_regs *regs)
91 * it with privilege level 3 because the IVE uses non-privileged accesses to these 91 * it with privilege level 3 because the IVE uses non-privileged accesses to these
92 * tables. IA-32 segmentation is used to protect against IA-32 accesses to them. 92 * tables. IA-32 segmentation is used to protect against IA-32 accesses to them.
93 */ 93 */
94 vma = kmem_cache_alloc(vm_area_cachep, GFP_KERNEL); 94 vma = kmem_cache_zalloc(vm_area_cachep, GFP_KERNEL);
95 if (vma) { 95 if (vma) {
96 memset(vma, 0, sizeof(*vma));
97 vma->vm_mm = current->mm; 96 vma->vm_mm = current->mm;
98 vma->vm_start = IA32_GDT_OFFSET; 97 vma->vm_start = IA32_GDT_OFFSET;
99 vma->vm_end = vma->vm_start + PAGE_SIZE; 98 vma->vm_end = vma->vm_start + PAGE_SIZE;
@@ -117,9 +116,8 @@ ia64_elf32_init (struct pt_regs *regs)
117 * code is locked in specific gate page, which is pointed by pretcode 116 * code is locked in specific gate page, which is pointed by pretcode
118 * when setup_frame_ia32 117 * when setup_frame_ia32
119 */ 118 */
120 vma = kmem_cache_alloc(vm_area_cachep, GFP_KERNEL); 119 vma = kmem_cache_zalloc(vm_area_cachep, GFP_KERNEL);
121 if (vma) { 120 if (vma) {
122 memset(vma, 0, sizeof(*vma));
123 vma->vm_mm = current->mm; 121 vma->vm_mm = current->mm;
124 vma->vm_start = IA32_GATE_OFFSET; 122 vma->vm_start = IA32_GATE_OFFSET;
125 vma->vm_end = vma->vm_start + PAGE_SIZE; 123 vma->vm_end = vma->vm_start + PAGE_SIZE;
@@ -142,9 +140,8 @@ ia64_elf32_init (struct pt_regs *regs)
142 * Install LDT as anonymous memory. This gives us all-zero segment descriptors 140 * Install LDT as anonymous memory. This gives us all-zero segment descriptors
143 * until a task modifies them via modify_ldt(). 141 * until a task modifies them via modify_ldt().
144 */ 142 */
145 vma = kmem_cache_alloc(vm_area_cachep, GFP_KERNEL); 143 vma = kmem_cache_zalloc(vm_area_cachep, GFP_KERNEL);
146 if (vma) { 144 if (vma) {
147 memset(vma, 0, sizeof(*vma));
148 vma->vm_mm = current->mm; 145 vma->vm_mm = current->mm;
149 vma->vm_start = IA32_LDT_OFFSET; 146 vma->vm_start = IA32_LDT_OFFSET;
150 vma->vm_end = vma->vm_start + PAGE_ALIGN(IA32_LDT_ENTRIES*IA32_LDT_ENTRY_SIZE); 147 vma->vm_end = vma->vm_start + PAGE_ALIGN(IA32_LDT_ENTRIES*IA32_LDT_ENTRY_SIZE);
@@ -214,12 +211,10 @@ ia32_setup_arg_pages (struct linux_binprm *bprm, int executable_stack)
214 bprm->loader += stack_base; 211 bprm->loader += stack_base;
215 bprm->exec += stack_base; 212 bprm->exec += stack_base;
216 213
217 mpnt = kmem_cache_alloc(vm_area_cachep, GFP_KERNEL); 214 mpnt = kmem_cache_zalloc(vm_area_cachep, GFP_KERNEL);
218 if (!mpnt) 215 if (!mpnt)
219 return -ENOMEM; 216 return -ENOMEM;
220 217
221 memset(mpnt, 0, sizeof(*mpnt));
222
223 down_write(&current->mm->mmap_sem); 218 down_write(&current->mm->mmap_sem);
224 { 219 {
225 mpnt->vm_mm = current->mm; 220 mpnt->vm_mm = current->mm;