mm: fix prctl_set_vma_anon_name

prctl_set_vma_anon_name could attempt to set the name across
two vmas at the same time due to a typo, which might corrupt
the vma list.  Fix it to use tmp instead of end to limit
the name setting to a single vma at a time.

Change-Id: Ie32d8ddb0fd547efbeedd6528acdab5ca5b308b4
Reported-by: Jed Davis <jld@mozilla.com>
Signed-off-by: Colin Cross <ccross@android.com>

SYSCALL_DEFINE2(old_getrlimit, unsigned int, resource,
 struct rlimit __user *, rlim)
{
 struct rlimit x;
 if (resource >= RLIM_NLIMITS)
 return -EINVAL;

	task_lock(current->group_leader);
	x = current->signal->rlim[resource];
	task_unlock(current->group_leader);
 if (x.rlim_cur > 0x7FFFFFFF)
		x.rlim_cur = 0x7FFFFFFF;
 if (x.rlim_max > 0x7FFFFFFF)
		x.rlim_max = 0x7FFFFFFF;
 return copy_to_user(rlim, &x, sizeof(x))?-EFAULT:0;
}

SYSCALL_DEFINE2(old_getrlimit, unsigned int, resource,
 struct rlimit __user *, rlim)
{
 struct rlimit x;
 if (resource >= RLIM_NLIMITS)
 return -EINVAL;

	task_lock(current->group_leader);
	x = current->signal->rlim[resource];
	task_unlock(current->group_leader);
 if (x.rlim_cur > 0x7FFFFFFF)
		x.rlim_cur = 0x7FFFFFFF;
 if (x.rlim_max > 0x7FFFFFFF)
		x.rlim_max = 0x7FFFFFFF;
 return copy_to_user(rlim, &x, sizeof(x))?-EFAULT:0;
}
