]> err.no Git - linux-2.6/blobdiff - arch/ppc/kernel/signal.c
[PATCH] ppc32: Kill init on unhandled synchronous signals
[linux-2.6] / arch / ppc / kernel / signal.c
index 9567d3041ea7c2e818c13987ad381ce997274768..2244bf91e593b1fd1ec13b596b4515e6c829987e 100644 (file)
@@ -511,7 +511,7 @@ int sys_rt_sigreturn(int r3, int r4, int r5, int r6, int r7, int r8,
 }
 
 int sys_debug_setcontext(struct ucontext __user *ctx,
-                        int ndbg, struct sig_dbg_op *dbg,
+                        int ndbg, struct sig_dbg_op __user *dbg,
                         int r6, int r7, int r8,
                         struct pt_regs *regs)
 {
@@ -632,7 +632,7 @@ handle_signal(unsigned long sig, struct k_sigaction *ka,
        if (__put_user((unsigned long) ka->sa.sa_handler, &sc->handler)
            || __put_user(oldset->sig[0], &sc->oldmask)
            || __put_user(oldset->sig[1], &sc->_unused[3])
-           || __put_user((struct pt_regs *)frame, &sc->regs)
+           || __put_user((struct pt_regs __user *)frame, &sc->regs)
            || __put_user(sig, &sc->signal))
                goto badframe;
 
@@ -705,10 +705,8 @@ int do_signal(sigset_t *oldset, struct pt_regs *regs)
        unsigned long frame, newsp;
        int signr, ret;
 
-       if (current->flags & PF_FREEZE) {
-               refrigerator(PF_FREEZE);
+       if (try_to_freeze()) {
                signr = 0;
-               ret = regs->gpr[3];
                if (!signal_pending(current))
                        goto no_signal;
        }
@@ -719,7 +717,7 @@ int do_signal(sigset_t *oldset, struct pt_regs *regs)
        newsp = frame = 0;
 
        signr = get_signal_to_deliver(&info, &ka, regs, NULL);
-
+ no_signal:
        if (TRAP(regs) == 0x0C00                /* System Call! */
            && regs->ccr & 0x10000000           /* error signalled */
            && ((ret = regs->gpr[3]) == ERESTARTSYS
@@ -735,7 +733,6 @@ int do_signal(sigset_t *oldset, struct pt_regs *regs)
                        regs->gpr[3] = EINTR;
                        /* note that the cr0.SO bit is already set */
                } else {
-no_signal:
                        regs->nip -= 4; /* Back up & retry system call */
                        regs->result = 0;
                        regs->trap = 0;
@@ -762,13 +759,12 @@ no_signal:
        else
                handle_signal(signr, &ka, &info, oldset, regs, newsp);
 
-       if (!(ka.sa.sa_flags & SA_NODEFER)) {
-               spin_lock_irq(&current->sighand->siglock);
-               sigorsets(&current->blocked,&current->blocked,&ka.sa.sa_mask);
+       spin_lock_irq(&current->sighand->siglock);
+       sigorsets(&current->blocked,&current->blocked,&ka.sa.sa_mask);
+       if (!(ka.sa.sa_flags & SA_NODEFER))
                sigaddset(&current->blocked, signr);
-               recalc_sigpending();
-               spin_unlock_irq(&current->sighand->siglock);
-       }
+       recalc_sigpending();
+       spin_unlock_irq(&current->sighand->siglock);
 
        return 1;
 }