Skip to content

Commit

Permalink
Hexagon: check to if we will overflow the signal stack
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Kuo <rkuo@codeaurora.org>
  • Loading branch information
Richard Kuo committed May 1, 2013
1 parent a11e67c commit 9cdae82
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions arch/hexagon/kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ static void __user *get_sigframe(struct k_sigaction *ka, struct pt_regs *regs,
{
unsigned long sp = regs->r29;

/* check if we would overflow the alt stack */
if (on_sig_stack(sp) && !likely(on_sig_stack(sp - frame_size)))
return (void __user __force *)-1UL;

/* Switch to signal stack if appropriate */
if ((ka->sa.sa_flags & SA_ONSTACK) && (sas_ss_flags(sp) == 0))
sp = current->sas_ss_sp + current->sas_ss_size;
Expand Down

0 comments on commit 9cdae82

Please sign in to comment.