diff options
author | Richard Kuo <rkuo@codeaurora.org> | 2012-05-29 18:56:39 -0500 |
---|---|---|
committer | Richard Kuo <rkuo@codeaurora.org> | 2013-03-27 22:14:00 -0500 |
commit | 5eae551998eb582271238e5cb87aa91fa0777011 (patch) | |
tree | 0f1bf441e463295ce8f2d5b0a0f9b57c2097844a | |
parent | 833b06cea62597576d7e2f8fb89379c968542087 (diff) | |
download | linux-hexagon-kernel-5eae551998eb582271238e5cb87aa91fa0777011.tar.gz |
Hexagon: check to if we will overflow the signal stack
Signed-off-by: Richard Kuo <rkuo@codeaurora.org>
-rw-r--r-- | arch/hexagon/kernel/signal.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/hexagon/kernel/signal.c b/arch/hexagon/kernel/signal.c index 8a20e8ed5d7d1c..097623c0c4b426 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; |