Skip to contentSkip to conversation

Fix compat uname machine

PATCH In review Andreas Schwab 3 participants 3 messages Apr 15, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix compat uname machine

Mask off personality flags when checking for PER_LINUX32.

---
On ppc64 you get this error:

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

because uname still reports ppc64 as the machine.

Andreas.

---
 kernel/sys.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
kernel/sys.c +1 -1
index 6d1a7e0..7cb426a 100644
@@ -1118,7 +1118,7 @@ DECLARE_RWSEM(uts_sem);
 
 #ifdef COMPAT_UTS_MACHINE
 #define override_architecture(name) \
-	(current->personality == PER_LINUX32 && \
+	(personality(current->personality) == PER_LINUX32 && \
 	 copy_to_user(name->machine, COMPAT_UTS_MACHINE, \
 		      sizeof(COMPAT_UTS_MACHINE)))
 #else
Signature · 7 lines
1.7.0.4


-- 
Andreas Schwab, [email protected]
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."