Commit 46da27664887fb95cedba53eafcf876de812c8c1

Authored by Andreas Schwab
Committed by Linus Torvalds
1 parent fb2162df74

kernel/sys.c: fix compat uname machine

On ppc64 you get this error:

  $ setarch ppc -R true
  setarch: ppc: Unrecognized architecture

because uname still reports ppc64 as the machine.

So mask off the personality flags when checking for PER_LINUX32.

Signed-off-by: Andreas Schwab <schwab@linux-m68k.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

... ... @@ -1118,7 +1118,7 @@
1118 1118  
1119 1119 #ifdef COMPAT_UTS_MACHINE
1120 1120 #define override_architecture(name) \
1121   - (current->personality == PER_LINUX32 && \
  1121 + (personality(current->personality) == PER_LINUX32 && \
1122 1122 copy_to_user(name->machine, COMPAT_UTS_MACHINE, \
1123 1123 sizeof(COMPAT_UTS_MACHINE)))
1124 1124 #else