summaryrefslogtreecommitdiffstats
path: root/arch/hexagon/kernel/signal.c
diff options
context:
space:
mode:
authorRichard Kuo <rkuo@codeaurora.org>2012-05-30 01:56:39 +0200
committerRichard Kuo <rkuo@codeaurora.org>2013-05-01 02:40:24 +0200
commit9cdae82d14f8f9e272304dccb48434482e57d43c (patch)
tree1640d27f7ef97236a4fe1a1ad44d3fd4383e82f6 /arch/hexagon/kernel/signal.c
parentHexagon: Signal and return path fixes (diff)
downloadlinux-9cdae82d14f8f9e272304dccb48434482e57d43c.tar.xz
linux-9cdae82d14f8f9e272304dccb48434482e57d43c.zip
Hexagon: check to if we will overflow the signal stack
Signed-off-by: Richard Kuo <rkuo@codeaurora.org>
Diffstat (limited to '')
-rw-r--r--arch/hexagon/kernel/signal.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/hexagon/kernel/signal.c b/arch/hexagon/kernel/signal.c
index 8a20e8ed5d7d..097623c0c4b4 100644
--- a/arch/hexagon/kernel/signal.c
+++ b/arch/hexagon/kernel/signal.c
@@ -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;