summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2011-02-20 13:22:52 +0100
committerRussell King <rmk+kernel@arm.linux.org.uk>2011-02-21 20:29:26 +0100
commit53399053eb505cf541b2405bd9d9bca5ecfb96fb (patch)
tree05b7fff7b081592087df18449dd6dd72537e522d /arch
parentARM: 6740/1: Place correctly notes section in the linker script (diff)
downloadlinux-53399053eb505cf541b2405bd9d9bca5ecfb96fb.tar.xz
linux-53399053eb505cf541b2405bd9d9bca5ecfb96fb.zip
ARM: Ensure predictable endian state on signal handler entry
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. Cc: <stable@kernel.org> Acked-by: Dave Martin <dave.martin@linaro.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/kernel/signal.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c
index 907d5a620bca..abaf8445ce25 100644
--- a/arch/arm/kernel/signal.c
+++ b/arch/arm/kernel/signal.c
@@ -474,7 +474,9 @@ setup_return(struct pt_regs *regs, struct k_sigaction *ka,
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.