[PATCH] s390: rt_sigreturn fix
authorCedric Le Goater <clg@fr.ibm.com>
Fri, 6 Jan 2006 08:19:10 +0000 (00:19 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Fri, 6 Jan 2006 16:33:49 +0000 (08:33 -0800)
Check return code of do_sigaltstack and force a SIGSEGV if it is -EFAULT.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Cedric Le Goater <clg@fr.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/s390/kernel/compat_signal.c
arch/s390/kernel/signal.c

index 4ff6808..fa2b3bc 100644 (file)
@@ -467,8 +467,6 @@ asmlinkage long sys32_rt_sigreturn(struct pt_regs *regs)
        if (err)
                goto badframe; 
 
-       /* It is more difficult to avoid calling this function than to
-          call it and ignore errors.  */
        set_fs (KERNEL_DS);
        do_sigaltstack((stack_t __user *)&st, NULL, regs->gprs[15]);
        set_fs (old_fs);
index 6e0110d..13592d0 100644 (file)
@@ -254,9 +254,9 @@ asmlinkage long sys_rt_sigreturn(struct pt_regs *regs)
        if (restore_sigregs(regs, &frame->uc.uc_mcontext))
                goto badframe;
 
-       /* It is more difficult to avoid calling this function than to
-          call it and ignore errors.  */
-       do_sigaltstack(&frame->uc.uc_stack, NULL, regs->gprs[15]);
+       if (do_sigaltstack(&frame->uc.uc_stack, NULL,
+                          regs->gprs[15]) == -EFAULT)
+               goto badframe;
        return regs->gprs[2];
 
 badframe: