Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933561Ab1C3VID (ORCPT ); Wed, 30 Mar 2011 17:08:03 -0400 Received: from mga09.intel.com ([134.134.136.24]:61735 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933533Ab1C3VH4 (ORCPT ); Wed, 30 Mar 2011 17:07:56 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.63,270,1299484800"; d="scan'208";a="621237444" From: Andi Kleen References: <20110330203.501921634@firstfloor.org> In-Reply-To: <20110330203.501921634@firstfloor.org> To: rmk+kernel@arm.linux.org.uk, rmk+kernel@arm.linux.org.uk, dave.martin@linaro.org, rmk+kernel@arm.linux.org.uk, gregkh@suse.de, ak@linux.intel.com, linux-kernel@vger.kernel.org, stable@kernel.org, tim.bird@am.sony.com Subject: [PATCH] [133/275] ARM: Ensure predictable endian state on signal handler entry Message-Id: <20110330210613.BBB773E1A05@tassilo.jf.intel.com> Date: Wed, 30 Mar 2011 14:06:13 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1583 Lines: 41 2.6.35-longterm review patch. If anyone has any objections, please let me know. ------------------ From: Russell King commit 53399053eb505cf541b2405bd9d9bca5ecfb96fb upstream. Ensure a predictable endian state when entering signal handlers. This avoids programs which use SETEND to momentarily switch their endian state from having their signal handlers entered with an unpredictable endian state. Acked-by: Dave Martin Signed-off-by: Russell King Signed-off-by: Greg Kroah-Hartman Signed-off-by: Andi Kleen --- arch/arm/kernel/signal.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) Index: linux-2.6.35.y/arch/arm/kernel/signal.c =================================================================== --- linux-2.6.35.y.orig/arch/arm/kernel/signal.c 2011-03-29 22:51:14.413354368 -0700 +++ linux-2.6.35.y/arch/arm/kernel/signal.c 2011-03-29 23:03:01.044273450 -0700 @@ -474,7 +474,9 @@ unsigned long handler = (unsigned long)ka->sa.sa_handler; unsigned long retcode; int thumb = 0; - unsigned long cpsr = regs->ARM_cpsr & ~PSR_f; + unsigned long cpsr = regs->ARM_cpsr & ~(PSR_f | PSR_E_BIT); + + cpsr |= PSR_ENDSTATE; /* * Maybe we need to deliver a 32-bit signal to a 26-bit task. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/