From 3554ecf0320f8c3a374ac64fa10aee0927a3ef0e Mon Sep 17 00:00:00 2001 From: Peter Wemm Date: Wed, 3 Dec 2003 07:00:30 +0000 Subject: [PATCH] Catch up with the procsig locking changes elsewhere. We were doing things like copyin/out with psp->ps_mtx held. That was not good. Approved by: re (scottl) --- sys/amd64/ia32/ia32_signal.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/amd64/ia32/ia32_signal.c b/sys/amd64/ia32/ia32_signal.c index ae5978ec507..0792309a41e 100644 --- a/sys/amd64/ia32/ia32_signal.c +++ b/sys/amd64/ia32/ia32_signal.c @@ -187,6 +187,7 @@ freebsd4_ia32_sendsig(sig_t catcher, int sig, sigset_t *mask, u_long code) p = td->td_proc; PROC_LOCK_ASSERT(p, MA_OWNED); psp = p->p_sigacts; + mtx_assert(&psp->ps_mtx, MA_OWNED); regs = td->td_frame; oonstack = sigonstack(regs->tf_rsp); @@ -250,6 +251,7 @@ freebsd4_ia32_sendsig(sig_t catcher, int sig, sigset_t *mask, u_long code) sf.sf_addr = regs->tf_addr; sf.sf_ah = (u_int32_t)(uintptr_t)catcher; } + mtx_unlock(&psp->ps_mtx); PROC_UNLOCK(p); /* @@ -274,6 +276,7 @@ freebsd4_ia32_sendsig(sig_t catcher, int sig, sigset_t *mask, u_long code) td->td_pcb->pcb_es = _udatasel; /* leave user %fs and %gs untouched */ PROC_LOCK(p); + mtx_lock(&psp->ps_mtx); } #endif /* COMPAT_FREEBSD4 */ @@ -298,6 +301,7 @@ ia32_sendsig(sig_t catcher, int sig, sigset_t *mask, u_long code) return; } #endif + mtx_assert(&psp->ps_mtx, MA_OWNED); regs = td->td_frame; oonstack = sigonstack(regs->tf_rsp); @@ -366,6 +370,7 @@ ia32_sendsig(sig_t catcher, int sig, sigset_t *mask, u_long code) sf.sf_addr = regs->tf_addr; sf.sf_ah = (u_int32_t)(uintptr_t)catcher; } + mtx_unlock(&psp->ps_mtx); PROC_UNLOCK(p); /* @@ -390,6 +395,7 @@ ia32_sendsig(sig_t catcher, int sig, sigset_t *mask, u_long code) td->td_pcb->pcb_es = _udatasel; /* leave user %fs and %gs untouched */ PROC_LOCK(p); + mtx_lock(&psp->ps_mtx); } /*