Commit 5ac22d4e authored by Tony Luck's avatar Tony Luck

[IA64] binfmt_elf32.c: BUG if insert_vm_struct fails

It seems that in ia64_elf32_init, instead of calling return, if we insert
an overlapping vma, we should instead BUG(). We should never get into this
code path, because the vma's are set above PAGE_OFFSET, and thus a
Xmalicious user can not trigger this code path. This change is being
suggested mainly for clarity. Thanks to Stephen Tweedie for pointing out
that returning early in ia64_elf32_init could have unpredictable results.
Signed-off-by: default avatarTony Luck <tony.luck@intel.com>
parent 3adc7a06
......@@ -103,7 +103,7 @@ ia64_elf32_init (struct pt_regs *regs)
if (insert_vm_struct(current->mm, vma)) {
kmem_cache_free(vm_area_cachep, vma);
up_write(&current->mm->mmap_sem);
return;
BUG();
}
}
up_write(&current->mm->mmap_sem);
......@@ -130,7 +130,7 @@ ia64_elf32_init (struct pt_regs *regs)
if (insert_vm_struct(current->mm, vma)) {
kmem_cache_free(vm_area_cachep, vma);
up_write(&current->mm->mmap_sem);
return;
BUG();
}
}
up_write(&current->mm->mmap_sem);
......@@ -153,7 +153,7 @@ ia64_elf32_init (struct pt_regs *regs)
if (insert_vm_struct(current->mm, vma)) {
kmem_cache_free(vm_area_cachep, vma);
up_write(&current->mm->mmap_sem);
return;
BUG();
}
}
up_write(&current->mm->mmap_sem);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment