Grab the process lock while calling psignal and before calling psignal.

This commit is contained in:
John Baldwin 2001-03-07 03:37:06 +00:00
parent 412503ae46
commit 19eb87d22a
36 changed files with 173 additions and 45 deletions

View File

@ -1278,8 +1278,8 @@ osendsig(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;
}
@ -1418,8 +1418,8 @@ 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;
}

View File

@ -619,8 +619,8 @@ osf1_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;
}

View File

@ -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);
}

View File

@ -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;

View File

@ -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);
}

View File

@ -300,13 +300,13 @@ linprocfs_ioctl(ap)
PROC_UNLOCK(procp);
return EINVAL; /* Can only start a stopped process */
}
PROC_UNLOCK(procp);
if ((signo = *(int*)ap->a_data) != 0) {
if (signo >= NSIG || signo <= 0)
if (signo >= NSIG || signo <= 0) {
PROC_UNLOCK(procp);
return EINVAL;
}
psignal(procp, signo);
}
PROC_LOCK(procp);
procp->p_step = 0;
PROC_UNLOCK(procp);
wakeup(&procp->p_step);

View File

@ -216,8 +216,11 @@ svr4_sendit(p, s, mp, flags)
if (auio.uio_resid != len && (error == ERESTART ||
error == EINTR || error == EWOULDBLOCK))
error = 0;
if (error == EPIPE)
if (error == EPIPE) {
PROC_LOCK(p);
psignal(p, SIGPIPE);
PROC_UNLOCK(p);
}
}
if (error == 0)
p->p_retval[0] = len - auio.uio_resid;

View File

@ -765,7 +765,9 @@ sc_mouse_ioctl(struct tty *tp, u_long cmd, caddr_t data, int flag,
cur_scp->mouse_proc = NULL;
cur_scp->mouse_pid = 0;
} else {
PROC_LOCK(cur_scp->mouse_proc);
psignal(cur_scp->mouse_proc, cur_scp->mouse_signal);
PROC_UNLOCK(cur_scp->mouse_proc);
break;
}
}
@ -818,7 +820,9 @@ sc_mouse_ioctl(struct tty *tp, u_long cmd, caddr_t data, int flag,
cur_scp->mouse_proc = NULL;
cur_scp->mouse_pid = 0;
} else {
PROC_LOCK(cur_scp->mouse_proc);
psignal(cur_scp->mouse_proc, cur_scp->mouse_signal);
PROC_UNLOCK(cur_scp->mouse_proc);
break;
}
}

View File

@ -2300,7 +2300,9 @@ signal_vt_rel(scr_stat *scp)
if (scp->smode.mode != VT_PROCESS)
return FALSE;
scp->status |= SWITCH_WAIT_REL;
PROC_LOCK(scp->proc);
psignal(scp->proc, scp->smode.relsig);
PROC_UNLOCK(scp->proc);
DPRINTF(5, ("sending relsig to %d\n", scp->pid));
return TRUE;
}
@ -2313,7 +2315,9 @@ signal_vt_acq(scr_stat *scp)
if (scp->sc->unit == sc_console_unit)
cons_unavail = TRUE;
scp->status |= SWITCH_WAIT_ACQ;
PROC_LOCK(scp->proc);
psignal(scp->proc, scp->smode.acqsig);
PROC_UNLOCK(scp->proc);
DPRINTF(5, ("sending acqsig to %d\n", scp->pid));
return TRUE;
}

View File

@ -366,7 +366,9 @@ uhid_intr(xfer, addr, status)
selwakeup(&sc->sc_rsel);
if (sc->sc_async != NULL) {
DPRINTFN(3, ("uhid_intr: sending SIGIO %p\n", sc->sc_async));
PROC_LOCK(sc->sc_async);
psignal(sc->sc_async, SIGIO);
PROC_UNLOCK(sc->sc_async);
}
}

View File

@ -51,13 +51,13 @@
#if defined(__NetBSD__) || defined(__OpenBSD__)
#include <sys/device.h>
#include <sys/kthread.h>
#include <sys/proc.h>
#elif defined(__FreeBSD__)
#include <sys/module.h>
#include <sys/bus.h>
#include <sys/filio.h>
#include <sys/uio.h>
#endif
#include <sys/proc.h>
#include <sys/conf.h>
#include <sys/poll.h>
#if __FreeBSD_version >= 500014
@ -683,8 +683,11 @@ usbd_add_event(type, dev)
SIMPLEQ_INSERT_TAIL(&usb_events, ueq, next);
wakeup(&usb_events);
selwakeup(&usb_selevent);
if (usb_async_proc != NULL)
if (usb_async_proc != NULL) {
PROC_LOCK(usb_async_proc);
psignal(usb_async_proc, SIGIO);
PROC_UNLOCK(usb_async_proc);
}
splx(s);
}

View File

@ -654,7 +654,9 @@ msdosfs_write(ap)
if (p &&
((uoff_t)uio->uio_offset + uio->uio_resid >
p->p_rlimit[RLIMIT_FSIZE].rlim_cur)) {
PROC_LOCK(p);
psignal(p, SIGXFSZ);
PROC_UNLOCK(p);
return (EFBIG);
}

View File

@ -237,7 +237,9 @@ nwfs_writevnode(vp, uiop, cred, ioflag)
}
if (uiop->uio_resid == 0) return 0;
if (p && uiop->uio_offset + uiop->uio_resid > p->p_rlimit[RLIMIT_FSIZE].rlim_cur) {
PROC_LOCK(p);
psignal(p, SIGXFSZ);
PROC_UNLOCK(p);
return (EFBIG);
}
error = ncp_write(NWFSTOCONN(nmp), &np->n_fh, uiop, cred);

View File

@ -222,7 +222,9 @@ WRITE(ap)
if (vp->v_type == VREG && p &&
uio->uio_offset + uio->uio_resid >
p->p_rlimit[RLIMIT_FSIZE].rlim_cur) {
PROC_LOCK(p);
psignal(p, SIGXFSZ);
PROC_UNLOCK(p);
return (EFBIG);
}

View File

@ -222,7 +222,9 @@ WRITE(ap)
if (vp->v_type == VREG && p &&
uio->uio_offset + uio->uio_resid >
p->p_rlimit[RLIMIT_FSIZE].rlim_cur) {
PROC_LOCK(p);
psignal(p, SIGXFSZ);
PROC_UNLOCK(p);
return (EFBIG);
}

View File

@ -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;

View File

@ -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);
}

View File

@ -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
{

View File

@ -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

View File

@ -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 */
}

View File

@ -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 */
}

View File

@ -843,8 +843,8 @@ 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;
}

View File

@ -411,8 +411,11 @@ dofilewrite(p, fp, fd, buf, nbyte, offset, flags)
if (auio.uio_resid != cnt && (error == ERESTART ||
error == EINTR || error == EWOULDBLOCK))
error = 0;
if (error == EPIPE)
if (error == EPIPE) {
PROC_LOCK(p);
psignal(p, SIGPIPE);
PROC_UNLOCK(p);
}
}
cnt -= auio.uio_resid;
#ifdef KTRACE
@ -504,8 +507,11 @@ writev(p, uap)
if (auio.uio_resid != cnt && (error == ERESTART ||
error == EINTR || error == EWOULDBLOCK))
error = 0;
if (error == EPIPE)
if (error == EPIPE) {
PROC_LOCK(p);
psignal(p, SIGPIPE);
PROC_UNLOCK(p);
}
}
cnt -= auio.uio_resid;
#ifdef KTRACE

View File

@ -1467,8 +1467,14 @@ ttymodem(tp, flag)
!ISSET(tp->t_cflag, CLOCAL)) {
SET(tp->t_state, TS_ZOMBIE);
CLR(tp->t_state, TS_CONNECTED);
if (tp->t_session && tp->t_session->s_leader)
psignal(tp->t_session->s_leader, SIGHUP);
if (tp->t_session && tp->t_session->s_leader) {
struct proc *p;
p = tp->t_session->s_leader;
PROC_LOCK(p);
psignal(p, SIGHUP);
PROC_UNLOCK(p);
}
ttyflush(tp, FREAD | FWRITE);
return (0);
}

View File

@ -593,8 +593,11 @@ sendit(p, s, mp, flags)
if (auio.uio_resid != len && (error == ERESTART ||
error == EINTR || error == EWOULDBLOCK))
error = 0;
if (error == EPIPE)
if (error == EPIPE) {
PROC_LOCK(p);
psignal(p, SIGPIPE);
PROC_UNLOCK(p);
}
}
if (error == 0)
p->p_retval[0] = len - auio.uio_resid;

View File

@ -609,8 +609,11 @@ aio_process(struct aiocblist *aiocbe)
if ((error) && (auio.uio_resid != cnt)) {
if (error == ERESTART || error == EINTR || error == EWOULDBLOCK)
error = 0;
if ((error == EPIPE) && (cb->aio_lio_opcode == LIO_WRITE))
if ((error == EPIPE) && (cb->aio_lio_opcode == LIO_WRITE)) {
PROC_LOCK(userp);
psignal(userp, SIGPIPE);
PROC_UNLOCK(userp);
}
}
cnt -= auio.uio_resid;
@ -800,10 +803,11 @@ aio_daemon(void *uproc)
lj->lioj_queue_count) &&
(lj->lioj_buffer_finished_count ==
lj->lioj_buffer_count)) {
psignal(userp,
lj->lioj_signal.sigev_signo);
lj->lioj_flags |=
LIOJ_SIGNAL_POSTED;
PROC_LOCK(userp);
psignal(userp,
lj->lioj_signal.sigev_signo);
PROC_UNLOCK(userp);
lj->lioj_flags |= LIOJ_SIGNAL_POSTED;
}
}
splx(s);
@ -834,7 +838,9 @@ aio_daemon(void *uproc)
}
if (cb->aio_sigevent.sigev_notify == SIGEV_SIGNAL) {
PROC_LOCK(userp);
psignal(userp, cb->aio_sigevent.sigev_signo);
PROC_UNLOCK(userp);
}
}
@ -1695,8 +1701,11 @@ aio_cancel(struct proc *p, struct aio_cancel_args *uap)
cancelled++;
/* XXX cancelled, knote? */
if (cbe->uaiocb.aio_sigevent.sigev_notify ==
SIGEV_SIGNAL)
SIGEV_SIGNAL) {
PROC_LOCK(cbe->userproc);
psignal(cbe->userproc, cbe->uaiocb.aio_sigevent.sigev_signo);
PROC_UNLOCK(cbe->userproc);
}
if (uap->aiocbp)
break;
}
@ -1734,8 +1743,11 @@ aio_cancel(struct proc *p, struct aio_cancel_args *uap)
cbe->uaiocb._aiocb_private.error = ECANCELED;
/* XXX cancelled, knote? */
if (cbe->uaiocb.aio_sigevent.sigev_notify ==
SIGEV_SIGNAL)
SIGEV_SIGNAL) {
PROC_LOCK(cbe->userproc);
psignal(cbe->userproc, cbe->uaiocb.aio_sigevent.sigev_signo);
PROC_UNLOCK(cbe->userproc);
}
} else {
notcancelled++;
}
@ -2050,13 +2062,18 @@ process_signal(void *aioj)
struct aiocb *cb = &aiocbe->uaiocb;
if ((lj) && (lj->lioj_signal.sigev_notify == SIGEV_SIGNAL) &&
(lj->lioj_queue_count == lj->lioj_queue_finished_count)) {
(lj->lioj_queue_count == lj->lioj_queue_finished_count)) {
PROC_LOCK(lj->lioj_ki->kaio_p);
psignal(lj->lioj_ki->kaio_p, lj->lioj_signal.sigev_signo);
PROC_UNLOCK(lj->lioj_ki->kaio_p);
lj->lioj_flags |= LIOJ_SIGNAL_POSTED;
}
if (cb->aio_sigevent.sigev_notify == SIGEV_SIGNAL)
if (cb->aio_sigevent.sigev_notify == SIGEV_SIGNAL) {
PROC_LOCK(aiocbe->userproc);
psignal(aiocbe->userproc, cb->aio_sigevent.sigev_signo);
PROC_UNLOCK(aiocbe->userproc);
}
}
/*

View File

@ -654,7 +654,9 @@ msdosfs_write(ap)
if (p &&
((uoff_t)uio->uio_offset + uio->uio_resid >
p->p_rlimit[RLIMIT_FSIZE].rlim_cur)) {
PROC_LOCK(p);
psignal(p, SIGXFSZ);
PROC_UNLOCK(p);
return (EFBIG);
}

View File

@ -823,7 +823,9 @@ nfs_write(ap)
*/
if (p && uio->uio_offset + uio->uio_resid >
p->p_rlimit[RLIMIT_FSIZE].rlim_cur) {
PROC_LOCK(p);
psignal(p, SIGXFSZ);
PROC_UNLOCK(p);
if (haverslock)
nfs_rsunlock(np, p);
return (EFBIG);
@ -1440,8 +1442,10 @@ nfs_doio(bp, cr, p)
(!(nmp->nm_flag & NFSMNT_NQNFS) &&
np->n_mtime != np->n_vattr.va_mtime.tv_sec))) {
uprintf("Process killed due to text file modification\n");
PROC_LOCK(p);
psignal(p, SIGKILL);
PHOLD(p);
_PHOLD(p);
PROC_UNLOCK(p);
}
break;
case VLNK:

View File

@ -823,7 +823,9 @@ nfs_write(ap)
*/
if (p && uio->uio_offset + uio->uio_resid >
p->p_rlimit[RLIMIT_FSIZE].rlim_cur) {
PROC_LOCK(p);
psignal(p, SIGXFSZ);
PROC_UNLOCK(p);
if (haverslock)
nfs_rsunlock(np, p);
return (EFBIG);
@ -1440,8 +1442,10 @@ nfs_doio(bp, cr, p)
(!(nmp->nm_flag & NFSMNT_NQNFS) &&
np->n_mtime != np->n_vattr.va_mtime.tv_sec))) {
uprintf("Process killed due to text file modification\n");
PROC_LOCK(p);
psignal(p, SIGKILL);
PHOLD(p);
_PHOLD(p);
PROC_UNLOCK(p);
}
break;
case VLNK:

View File

@ -237,7 +237,9 @@ nwfs_writevnode(vp, uiop, cred, ioflag)
}
if (uiop->uio_resid == 0) return 0;
if (p && uiop->uio_offset + uiop->uio_resid > p->p_rlimit[RLIMIT_FSIZE].rlim_cur) {
PROC_LOCK(p);
psignal(p, SIGXFSZ);
PROC_UNLOCK(p);
return (EFBIG);
}
error = ncp_write(NWFSTOCONN(nmp), &np->n_fh, uiop, cred);

View File

@ -523,8 +523,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;
}
@ -605,7 +605,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;
@ -684,8 +686,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;
}
@ -753,7 +755,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;

View File

@ -523,8 +523,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;
}
@ -605,7 +605,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;
@ -684,8 +686,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;
}
@ -753,7 +755,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;

View File

@ -835,7 +835,9 @@ npx_intr(dummy)
*
* Treat them like a true async interrupt.
*/
PROC_LOCK(p);
psignal(curproc, SIGFPE);
PROC_UNLOCK(p);
}
mtx_unlock(&Giant);
}

View File

@ -2314,7 +2314,9 @@ signal_vt_rel(scr_stat *scp)
if (scp->smode.mode != VT_PROCESS)
return FALSE;
scp->status |= SWITCH_WAIT_REL;
PROC_LOCK(scp->proc);
psignal(scp->proc, scp->smode.relsig);
PROC_UNLOCK(scp->proc);
DPRINTF(5, ("sending relsig to %d\n", scp->pid));
return TRUE;
}
@ -2327,7 +2329,9 @@ signal_vt_acq(scr_stat *scp)
if (scp->sc->unit == sc_console_unit)
cons_unavail = TRUE;
scp->status |= SWITCH_WAIT_ACQ;
PROC_LOCK(scp->proc);
psignal(scp->proc, scp->smode.acqsig);
PROC_UNLOCK(scp->proc);
DPRINTF(5, ("sending acqsig to %d\n", scp->pid));
return TRUE;
}

View File

@ -649,8 +649,11 @@ meteor_intr(void *arg)
* If the user requested to be notified via signal,
* let them know the field is complete.
*/
if(mtr->proc && (mtr->signal & METEOR_SIG_MODE_MASK))
if(mtr->proc && (mtr->signal & METEOR_SIG_MODE_MASK)) {
PROC_LOCK(mtr->proc);
psignal(mtr->proc, mtr->signal&(~METEOR_SIG_MODE_MASK));
PROC_UNLOCK(mtr->proc);
}
}
if (status & 0x2) { /* odd field */
mtr->odd_fields_captured++;
@ -663,8 +666,11 @@ meteor_intr(void *arg)
* If the user requested to be notified via signal,
* let them know the field is complete.
*/
if(mtr->proc && (mtr->signal & METEOR_SIG_MODE_MASK))
if(mtr->proc && (mtr->signal & METEOR_SIG_MODE_MASK)) {
PROC_LOCK(mtr->proc);
psignal(mtr->proc, mtr->signal&(~METEOR_SIG_MODE_MASK));
PROC_UNLOCK(mtr->proc);
}
}
/*
@ -696,8 +702,11 @@ meteor_intr(void *arg)
* If the user requested to be notified via signal,
* let them know the frame is complete.
*/
if(mtr->proc && !(mtr->signal & METEOR_SIG_MODE_MASK))
if(mtr->proc && !(mtr->signal & METEOR_SIG_MODE_MASK)) {
PROC_LOCK(mtr->proc);
psignal(mtr->proc, mtr->signal&(~METEOR_SIG_MODE_MASK));
PROC_UNLOCK(mtr->proc);
}
/*
* Reset the want flags if in continuous or
* synchronous capture mode.

View File

@ -440,7 +440,9 @@ WRITE(ap)
if (vp->v_type == VREG && p &&
uio->uio_offset + uio->uio_resid >
p->p_rlimit[RLIMIT_FSIZE].rlim_cur) {
PROC_LOCK(p);
psignal(p, SIGXFSZ);
PROC_UNLOCK(p);
if (object)
vm_object_vndeallocate(object);
return (EFBIG);