From patchwork Wed Apr 13 04:01:52 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Pitre X-Patchwork-Id: 991 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:48:05 -0000 Delivered-To: patches@linaro.org Received: by 10.68.59.138 with SMTP id z10cs267959pbq; Tue, 12 Apr 2011 21:01:56 -0700 (PDT) Received: by 10.229.27.201 with SMTP id j9mr1554812qcc.243.1302667315379; Tue, 12 Apr 2011 21:01:55 -0700 (PDT) Received: from mail-vw0-f50.google.com (mail-vw0-f50.google.com [209.85.212.50]) by mx.google.com with ESMTPS id j5si244477qcu.117.2011.04.12.21.01.54 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 12 Apr 2011 21:01:55 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.50 is neither permitted nor denied by best guess record for domain of nicolas.pitre@linaro.org) client-ip=209.85.212.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.50 is neither permitted nor denied by best guess record for domain of nicolas.pitre@linaro.org) smtp.mail=nicolas.pitre@linaro.org Received: by vws14 with SMTP id 14so225353vws.37 for ; Tue, 12 Apr 2011 21:01:54 -0700 (PDT) Received: by 10.220.109.134 with SMTP id j6mr2059698vcp.252.1302667314532; Tue, 12 Apr 2011 21:01:54 -0700 (PDT) Received: from xanadu.home (modemcable092.28-130-66.mc.videotron.ca [66.130.28.92]) by mx.google.com with ESMTPS id p29sm33303vcr.7.2011.04.12.21.01.53 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 12 Apr 2011 21:01:53 -0700 (PDT) Date: Wed, 13 Apr 2011 00:01:52 -0400 (EDT) From: Nicolas Pitre X-X-Sender: nico@xanadu.home To: patches@arm.linux.org.uk cc: patches@linaro.org Subject: fix personality test wrt usage of domain handlers Message-ID: User-Agent: Alpine 2.00 (LFD 1167 2008-08-23) MIME-Version: 1.0 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 PATCH FOLLOWS 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;