]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/s390/kernel/compat_signal.c
Merge branch 'next' into for-linus
[linux-2.6-omap-h63xx.git] / arch / s390 / kernel / compat_signal.c
index 80a54a0149ab5956935476b56b28855b262d6f15..b537cb0e9b55f607652f217f802ac7c2d8358d0b 100644 (file)
@@ -14,7 +14,6 @@
 #include <linux/sched.h>
 #include <linux/mm.h>
 #include <linux/smp.h>
-#include <linux/smp_lock.h>
 #include <linux/kernel.h>
 #include <linux/signal.h>
 #include <linux/errno.h>
@@ -30,6 +29,7 @@
 #include <asm/lowcore.h>
 #include "compat_linux.h"
 #include "compat_ptrace.h"
+#include "entry.h"
 
 #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
 
@@ -340,7 +340,7 @@ static int restore_sigregs32(struct pt_regs *regs,_sigregs32 __user *sregs)
                return err;
 
        restore_fp_regs(&current->thread.fp_regs);
-       regs->trap = -1;        /* disable syscall checks */
+       regs->svcnr = 0;        /* disable syscall checks */
        return 0;
 }
 
@@ -429,6 +429,10 @@ get_sigframe(struct k_sigaction *ka, struct pt_regs * regs, size_t frame_size)
        /* Default to using normal stack */
        sp = (unsigned long) A(regs->gprs[15]);
 
+       /* Overflow on alternate signal stack gives SIGSEGV. */
+       if (on_sig_stack(sp) && !on_sig_stack((sp - frame_size) & -8UL))
+               return (void __user *) -1UL;
+
        /* This is the X/Open sanctioned signal stack switching.  */
        if (ka->sa.sa_flags & SA_ONSTACK) {
                if (! sas_ss_flags(sp))
@@ -462,6 +466,9 @@ static int setup_frame32(int sig, struct k_sigaction *ka,
        if (!access_ok(VERIFY_WRITE, frame, sizeof(sigframe32)))
                goto give_sigsegv;
 
+       if (frame == (void __user *) -1UL)
+               goto give_sigsegv;
+
        if (__copy_to_user(&frame->sc.oldmask, &set->sig, _SIGMASK_COPY_SIZE32))
                goto give_sigsegv;
 
@@ -515,6 +522,9 @@ static int setup_rt_frame32(int sig, struct k_sigaction *ka, siginfo_t *info,
        if (!access_ok(VERIFY_WRITE, frame, sizeof(rt_sigframe32)))
                goto give_sigsegv;
 
+       if (frame == (void __user *) -1UL)
+               goto give_sigsegv;
+
        if (copy_siginfo_to_user32(&frame->info, info))
                goto give_sigsegv;