diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-02-20 12:22:52 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-03-21 12:45:12 -0700 |
commit | e10f8b1c1104d1304c16c238235b1bc6e37f563c (patch) | |
tree | 1ff06a387f647d46ba8ffc387396ac365a8d44bc /arch/arm | |
parent | 717587acd84b74c24a16cc11f61777c259ea5c54 (diff) | |
download | lwn-e10f8b1c1104d1304c16c238235b1bc6e37f563c.tar.gz lwn-e10f8b1c1104d1304c16c238235b1bc6e37f563c.zip |
ARM: Ensure predictable endian state on signal handler entry
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 <dave.martin@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/kernel/signal.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c index e7714f367eb8..962236acfee2 100644 --- a/arch/arm/kernel/signal.c +++ b/arch/arm/kernel/signal.c @@ -389,7 +389,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. |