fix personality test wrt usage of domain handlers

Message ID alpine.LFD.2.00.1104130000060.28032@xanadu.home
State New
Headers show

Commit Message

Nicolas Pitre April 13, 2011, 4:01 a.m.
There are optional bits that may complement a personality ID.  It is
therefore wrong to simply test against the absolute current->personality
value to determine the effective personality.  The PER_LINUX_32BIT is
itself just PER_LINUX with one of those optional bits set.

Signed-off-by: Nicolas Pitre <>
KernelVersion: v2.6.39-rc1


diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index 62ae0eb..0a7fb37 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -418,8 +418,7 @@  static int bad_syscall(int n, struct pt_regs *regs)
 	struct thread_info *thread = current_thread_info();
 	siginfo_t info;
-	if (current->personality != PER_LINUX &&
-	    current->personality != PER_LINUX_32BIT &&
+	if ((current->personality & PER_MASK) != PER_LINUX &&
 	    thread->exec_domain->handler) {
 		thread->exec_domain->handler(n, regs);
 		return regs->ARM_r0;