Commit 4a39048c authored by Arun Sharma's avatar Arun Sharma Committed by David Mosberger

[PATCH] ia64: ia32 emulation fixes for 2.5.45

I found that Linux 2.5.45 had some problems passing arguments to ia32
programs running on ia64 in emulation mode.

The attached patch fixes the problems.
parent 2cc6e0e0
......@@ -162,9 +162,11 @@ ia32_setup_arg_pages (struct linux_binprm *bprm)
{
unsigned long stack_base;
struct vm_area_struct *mpnt;
struct mm_struct *mm = current->mm;
int i;
stack_base = IA32_STACK_TOP - MAX_ARG_PAGES*PAGE_SIZE;
mm->arg_start = bprm->p + stack_base;
bprm->p += stack_base;
if (bprm->loader)
......@@ -175,6 +177,11 @@ ia32_setup_arg_pages (struct linux_binprm *bprm)
if (!mpnt)
return -ENOMEM;
if (!vm_enough_memory((IA32_STACK_TOP - (PAGE_MASK & (unsigned long) bprm->p))>>PAGE_SHIFT)) {
kmem_cache_free(vm_area_cachep, mpnt);
return -ENOMEM;
}
down_write(&current->mm->mmap_sem);
{
mpnt->vm_mm = current->mm;
......
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