Skip to content

Commit

Permalink
ARM: Ensure predictable endian state on signal handler entry
Browse files Browse the repository at this point in the history
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: <[email protected]>
Acked-by: Dave Martin <[email protected]>
Signed-off-by: Russell King <[email protected]>
  • Loading branch information
Russell King committed Feb 21, 2011
1 parent dc810ef commit 5339905
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion arch/arm/kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 5339905

Please sign in to comment.