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>

static int override_release(char __user *release, size_t len)
{
 int ret = 0;

 if (current->personality & UNAME26) {
 const char *rest = UTS_RELEASE;
 char buf[65] = { 0 };
 int ndots = 0;
 unsigned v;
 size_t copy;

 while (*rest) {
 if (*rest == '.' && ++ndots >= 3)
 break;
 if (!isdigit(*rest) && *rest != '.')
 break;
			rest++;
 }
		v = ((LINUX_VERSION_CODE >> 8) & 0xff) + 40;
		copy = clamp_t(size_t, len, 1, sizeof(buf));
		copy = scnprintf(buf, copy, "2.6.%u%s", v, rest);
		ret = copy_to_user(release, buf, copy + 1);
 }
 return ret;
}

static int override_release(char __user *release, size_t len)
{
 int ret = 0;

 if (current->personality & UNAME26) {
 const char *rest = UTS_RELEASE;
 char buf[65] = { 0 };
 int ndots = 0;
 unsigned v;
 size_t copy;

 while (*rest) {
 if (*rest == '.' && ++ndots >= 3)
 break;
 if (!isdigit(*rest) && *rest != '.')
 break;
			rest++;
 }
		v = ((LINUX_VERSION_CODE >> 8) & 0xff) + 40;
		copy = clamp_t(size_t, len, 1, sizeof(buf));
		copy = scnprintf(buf, copy, "2.6.%u%s", v, rest);
		ret = copy_to_user(release, buf, copy + 1);
 }
 return ret;
}
