]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - arch/hexagon/kernel/signal.c
Merge tag 'for-linus-20130509' of git://git.infradead.org/~dwmw2/random-2.6
[karo-tx-linux.git] / arch / hexagon / kernel / signal.c
index 8a20e8ed5d7d1cb6317079ef402b9c5de3ca27f7..d7c73874b5150312196e484bc294b02e14bc7558 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Signal support for Hexagon processor
  *
- * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2010-2012, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
@@ -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;