lkml.org 
[lkml]   [2011]   [Mar]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] [133/275] ARM: Ensure predictable endian state on signal handler entry
Date
2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Russell King <rmk+kernel@arm.linux.org.uk>

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>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
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.

\
 
 \ /
  Last update: 2011-03-30 23:45    [from the cache]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site