 if (security_vm_enough_memory((IA32_STACK_TOP - (PAGE_MASK & (unsigned long) bprm->p))>>PAGE_SHIFT)) { kmem_cache_free(vm_area_cachep, mpnt); return -ENOMEM; } 
int setup_arg_pages(struct linux_binprm *bprm, unsigned long stack_top, int executable_stack){	unsigned long stack_base;	struct vm_area_struct *mpnt;	struct mm_struct *mm = current->mm;	int i, ret;	stack_base = IA32_STACK_TOP - MAX_ARG_PAGES * PAGE_SIZE;	mm->arg_start = bprm->p + stack_base;	bprm->p += stack_base;	if (bprm->loader)		bprm->loader += stack_base;	bprm->exec += stack_base;	mpnt = kmem_cache_alloc(vm_area_cachep, SLAB_KERNEL);	if (!mpnt) 		return -ENOMEM; 		if (security_vm_enough_memory((IA32_STACK_TOP - (PAGE_MASK & (unsigned long) bprm->p))>>PAGE_SHIFT)) {		kmem_cache_free(vm_area_cachep, mpnt);		return -ENOMEM;	}	memset(mpnt, 0, sizeof(*mpnt));	down_write(&mm->mmap_sem);	{		mpnt->vm_mm = mm;		mpnt->vm_start = PAGE_MASK & (unsigned long) bprm->p;		mpnt->vm_end = IA32_STACK_TOP;		if (executable_stack == EXSTACK_ENABLE_X)			mpnt->vm_flags = VM_STACK_FLAGS |  VM_EXEC;		else if (executable_stack == EXSTACK_DISABLE_X)			mpnt->vm_flags = VM_STACK_FLAGS & ~VM_EXEC;		else			mpnt->vm_flags = VM_STACK_FLAGS; 		mpnt->vm_page_prot = (mpnt->vm_flags & VM_EXEC) ?  			PAGE_COPY_EXEC : PAGE_COPY;		if ((ret = insert_vm_struct(mm, mpnt))) {			up_write(&mm->mmap_sem);			kmem_cache_free(vm_area_cachep, mpnt);			return ret;		}		mm->stack_vm = mm->total_vm = vma_pages(mpnt);	} 	for (i = 0 ; i < MAX_ARG_PAGES ; i++) {		struct page *page = bprm->page[i];		if (page) {			bprm->page[i] = NULL;			install_arg_page(mpnt, page, stack_base);		}		stack_base += PAGE_SIZE;	}	up_write(&mm->mmap_sem);		return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/2fd4ef85e0db9ed75c98e13953257a967ea55e03/ia32_binfmt.c/buggy/arch/x86_64/ia32/ia32_binfmt.c