/* Create a new mm_struct and populate it with a temporary stack vm_area_struct. We don't have enough context at this point to set the stack flags, permissions, and offset, so we use temporary values. We'll update them later in setup_arg_pages().  */
int bprm_mm_init(struct linux_binprm *bprm)
/* Create a new mm_struct and populate it with a temporary stack vm_area_struct. We don't have enough context at this point to set the stack flags, permissions, and offset, so we use temporary values. We'll update them later in setup_arg_pages().  */
int bprm_mm_init(struct linux_binprm *bprm)
{
	int err;
	struct mm_struct *mm = NULL;
	bprm->mm = mm = mm_alloc();
	err = -ENOMEM;
	if (!mm)
		goto err;
	err = init_new_context(current, mm);
	if (err)
		goto err;
	err = __bprm_mm_init(bprm);
	if (err)
		goto err;
	return 0;
err:
	if (mm) {
		bprm->mm = NULL;
		mmdrop(mm);
	}
	return err;
}