Commit ffed4cce authored by Andi Kleen's avatar Andi Kleen Committed by Linus Torvalds

[PATCH] Fix linux32 personality on x86-64

Make linux32 ... on x86-64 to do proper uname emulation again.

Also changes i386 to i686 because that's more near the truth.
parent ea127f97
...@@ -1422,8 +1422,9 @@ asmlinkage long sys32_olduname(struct oldold_utsname * name) ...@@ -1422,8 +1422,9 @@ asmlinkage long sys32_olduname(struct oldold_utsname * name)
__copy_to_user(&name->version,&system_utsname.version,__OLD_UTS_LEN); __copy_to_user(&name->version,&system_utsname.version,__OLD_UTS_LEN);
__put_user(0,name->version+__OLD_UTS_LEN); __put_user(0,name->version+__OLD_UTS_LEN);
{ {
char *arch = current->personality == PER_LINUX32 char *arch = "x86_64";
? "i386" : "x86_64"; if (personality(current->personality) == PER_LINUX32)
arch = "i686";
__copy_to_user(&name->machine,arch,strlen(arch)+1); __copy_to_user(&name->machine,arch,strlen(arch)+1);
} }
...@@ -1443,7 +1444,7 @@ long sys32_uname(struct old_utsname * name) ...@@ -1443,7 +1444,7 @@ long sys32_uname(struct old_utsname * name)
down_read(&uts_sem); down_read(&uts_sem);
err=copy_to_user(name, &system_utsname, sizeof (*name)); err=copy_to_user(name, &system_utsname, sizeof (*name));
up_read(&uts_sem); up_read(&uts_sem);
if (current->personality == PER_LINUX32) if (personality(current->personality) == PER_LINUX32)
err |= copy_to_user(&name->machine, "i686", 5); err |= copy_to_user(&name->machine, "i686", 5);
return err?-EFAULT:0; return err?-EFAULT:0;
} }
......
...@@ -112,8 +112,8 @@ asmlinkage long sys_uname(struct new_utsname * name) ...@@ -112,8 +112,8 @@ asmlinkage long sys_uname(struct new_utsname * name)
down_read(&uts_sem); down_read(&uts_sem);
err = copy_to_user(name, &system_utsname, sizeof (*name)); err = copy_to_user(name, &system_utsname, sizeof (*name));
up_read(&uts_sem); up_read(&uts_sem);
if (current->personality == PER_LINUX32) if (personality(current->personality) == PER_LINUX32)
err |= copy_to_user(&name->machine, "i386", 5); err |= copy_to_user(&name->machine, "i686", 5);
return err ? -EFAULT : 0; return err ? -EFAULT : 0;
} }
......
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