diff options
author | jhb <jhb@FreeBSD.org> | 2001-03-07 03:37:06 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2001-03-07 03:37:06 +0000 |
commit | 9cd254601baefc2dc9c953abe9747717374ff8b1 (patch) | |
tree | ac4298224e8af28e8b2f904a43a2925c21dfc798 /sys/i386 | |
parent | ace71d59bf35fa6d911520ec855d0100773422a8 (diff) | |
download | FreeBSD-src-9cd254601baefc2dc9c953abe9747717374ff8b1.zip FreeBSD-src-9cd254601baefc2dc9c953abe9747717374ff8b1.tar.gz |
Grab the process lock while calling psignal and before calling psignal.
Diffstat (limited to 'sys/i386')
-rw-r--r-- | sys/i386/i386/machdep.c | 8 | ||||
-rw-r--r-- | sys/i386/isa/npx.c | 2 | ||||
-rw-r--r-- | sys/i386/isa/pcvt/pcvt_ext.c | 25 | ||||
-rw-r--r-- | sys/i386/isa/spigot.c | 5 | ||||
-rw-r--r-- | sys/i386/linux/linux_sysvec.c | 6 | ||||
-rw-r--r-- | sys/i386/svr4/svr4_machdep.c | 1 |
6 files changed, 37 insertions, 10 deletions
diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c index 0118473..5d9f8bd 100644 --- a/sys/i386/i386/machdep.c +++ b/sys/i386/i386/machdep.c @@ -510,8 +510,8 @@ osendsig(catcher, sig, mask, code) SIGDELSET(p->p_sigignore, SIGILL); SIGDELSET(p->p_sigcatch, SIGILL); SIGDELSET(p->p_sigmask, SIGILL); - PROC_UNLOCK(p); psignal(p, SIGILL); + PROC_UNLOCK(p); return; } @@ -592,7 +592,9 @@ osendsig(catcher, sig, mask, code) * Something is wrong with the stack pointer. * ...Kill the process. */ + PROC_LOCK(p); sigexit(p, SIGILL); + /* NOTREACHED */ } regs->tf_esp = (int)fp; @@ -671,8 +673,8 @@ sendsig(catcher, sig, mask, code) SIGDELSET(p->p_sigignore, SIGILL); SIGDELSET(p->p_sigcatch, SIGILL); SIGDELSET(p->p_sigmask, SIGILL); - PROC_UNLOCK(p); psignal(p, SIGILL); + PROC_UNLOCK(p); return; } @@ -740,7 +742,9 @@ sendsig(catcher, sig, mask, code) * Something is wrong with the stack pointer. * ...Kill the process. */ + PROC_LOCK(p); sigexit(p, SIGILL); + /* NOTREACHED */ } regs->tf_esp = (int)sfp; diff --git a/sys/i386/isa/npx.c b/sys/i386/isa/npx.c index 0dab6ae..87d274b 100644 --- a/sys/i386/isa/npx.c +++ b/sys/i386/isa/npx.c @@ -781,7 +781,9 @@ npx_intr(dummy) * * Treat them like a true async interrupt. */ + PROC_LOCK(curproc); psignal(curproc, SIGFPE); + PROC_UNLOCK(curproc); } mtx_unlock(&Giant); } diff --git a/sys/i386/isa/pcvt/pcvt_ext.c b/sys/i386/isa/pcvt/pcvt_ext.c index 50ded4e..3f0e954 100644 --- a/sys/i386/isa/pcvt/pcvt_ext.c +++ b/sys/i386/isa/pcvt/pcvt_ext.c @@ -2294,11 +2294,17 @@ vgapage(int new_screen) /* Try resignaling uncooperative X-window servers */ if (vsp->smode.mode == VT_PROCESS) { if (vsp->vt_status & VT_WAIT_REL) { - if(vsp->smode.relsig) + if(vsp->smode.relsig) { + PROC_LOCK(vsp->proc); psignal(vsp->proc, vsp->smode.relsig); + PROC_UNLOCK(vsp->proc); + } } else if (vsp->vt_status & VT_WAIT_ACK) { - if(vsp->smode.acqsig) + if(vsp->smode.acqsig) { + PROC_LOCK(vsp->proc); psignal(vsp->proc, vsp->smode.acqsig); + PROC_UNLOCK(vsp->proc); + } } } return EAGAIN; @@ -2310,8 +2316,11 @@ vgapage(int new_screen) { /* we cannot switch immediately here */ vsp->vt_status |= VT_WAIT_REL; - if(vsp->smode.relsig) + if(vsp->smode.relsig) { + PROC_LOCK(vsp->proc); psignal(vsp->proc, vsp->smode.relsig); + PROC_UNLOCK(vsp->proc); + } } else { @@ -2341,8 +2350,11 @@ vgapage(int new_screen) { /* if _new_ vt is under process control... */ vsp->vt_status |= VT_WAIT_ACK; - if(vsp->smode.acqsig) + if(vsp->smode.acqsig) { + PROC_LOCK(vsp->proc); psignal(vsp->proc, vsp->smode.acqsig); + PROC_UNLOCK(vsp->proc); + } } else { @@ -2502,9 +2514,12 @@ usl_vt_ioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p) */ vsp->vt_status |= VT_WAIT_ACK; - if(vsp->smode.acqsig) + if(vsp->smode.acqsig) { + PROC_LOCK(vsp->proc); psignal(vsp->proc, vsp->smode.acqsig); + PROC_UNLOCK(vsp->proc); + } } else { diff --git a/sys/i386/isa/spigot.c b/sys/i386/isa/spigot.c index 4c638d5..96272df 100644 --- a/sys/i386/isa/spigot.c +++ b/sys/i386/isa/spigot.c @@ -266,8 +266,11 @@ spigintr(int unit) { struct spigot_softc *ss = (struct spigot_softc *)&spigot_softc[unit]; - if(ss->p && ss->signal_num) + if(ss->p && ss->signal_num) { + PROC_LOCK(ss->p); psignal(ss->p, ss->signal_num); + PROC_UNLOCK(ss->p); + } } static int diff --git a/sys/i386/linux/linux_sysvec.c b/sys/i386/linux/linux_sysvec.c index dc20e07..8050392 100644 --- a/sys/i386/linux/linux_sysvec.c +++ b/sys/i386/linux/linux_sysvec.c @@ -246,13 +246,13 @@ linux_rt_sendsig(sig_t catcher, int sig, sigset_t *mask, u_long code) SIGDELSET(p->p_sigignore, SIGILL); SIGDELSET(p->p_sigcatch, SIGILL); SIGDELSET(p->p_sigmask, SIGILL); - PROC_UNLOCK(p); #ifdef DEBUG if (ldebug(sigreturn)) printf(LMSG("rt_sendsig: bad stack %p, oonstack=%x"), fp, oonstack); #endif psignal(p, SIGILL); + PROC_UNLOCK(p); return; } @@ -320,6 +320,7 @@ linux_rt_sendsig(sig_t catcher, int sig, sigset_t *mask, u_long code) * Process has trashed its stack; give it an illegal * instruction to halt it in its tracks. */ + PROC_LOCK(p); sigexit(p, SIGILL); /* NOTREACHED */ } @@ -404,8 +405,8 @@ linux_sendsig(sig_t catcher, int sig, sigset_t *mask, u_long code) SIGDELSET(p->p_sigignore, SIGILL); SIGDELSET(p->p_sigcatch, SIGILL); SIGDELSET(p->p_sigmask, SIGILL); - PROC_UNLOCK(p); psignal(p, SIGILL); + PROC_UNLOCK(p); return; } @@ -454,6 +455,7 @@ linux_sendsig(sig_t catcher, int sig, sigset_t *mask, u_long code) * Process has trashed its stack; give it an illegal * instruction to halt it in its tracks. */ + PROC_LOCK(p); sigexit(p, SIGILL); /* NOTREACHED */ } diff --git a/sys/i386/svr4/svr4_machdep.c b/sys/i386/svr4/svr4_machdep.c index 00bb45a..1541835 100644 --- a/sys/i386/svr4/svr4_machdep.c +++ b/sys/i386/svr4/svr4_machdep.c @@ -467,6 +467,7 @@ svr4_sendsig(catcher, sig, mask, code) * Process has trashed its stack; give it an illegal * instruction to halt it in its tracks. */ + PROC_LOCK(p); sigexit(p, SIGILL); /* NOTREACHED */ } |