summaryrefslogtreecommitdiffstats
path: root/sys/powerpc/aim
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2009-10-27 10:47:58 +0000
committerkib <kib@FreeBSD.org>2009-10-27 10:47:58 +0000
commitce081b037e7a762f0dd090a207cafc5121f39f51 (patch)
tree359a5b0885ae5a789f55ba40dc485621e67c34b1 /sys/powerpc/aim
parenteb4c68098b66d84de3abc7be00acfdc6d2f8f980 (diff)
downloadFreeBSD-src-ce081b037e7a762f0dd090a207cafc5121f39f51.zip
FreeBSD-src-ce081b037e7a762f0dd090a207cafc5121f39f51.tar.gz
In r197963, a race with thread being selected for signal delivery
while in kernel mode, and later changing signal mask to block the signal, was fixed for sigprocmask(2) and ptread_exit(3). The same race exists for sigreturn(2), setcontext(2) and swapcontext(2) syscalls. Use kern_sigprocmask() instead of direct manipulation of td_sigmask to reschedule newly blocked signals, closing the race. Reviewed by: davidxu Tested by: pho MFC after: 1 month
Diffstat (limited to 'sys/powerpc/aim')
-rw-r--r--sys/powerpc/aim/machdep.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/sys/powerpc/aim/machdep.c b/sys/powerpc/aim/machdep.c
index da73dfa..713402e 100644
--- a/sys/powerpc/aim/machdep.c
+++ b/sys/powerpc/aim/machdep.c
@@ -692,7 +692,6 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
int
sigreturn(struct thread *td, struct sigreturn_args *uap)
{
- struct proc *p;
ucontext_t uc;
int error;
@@ -707,12 +706,7 @@ sigreturn(struct thread *td, struct sigreturn_args *uap)
if (error != 0)
return (error);
- p = td->td_proc;
- PROC_LOCK(p);
- td->td_sigmask = uc.uc_sigmask;
- SIG_CANTMASK(td->td_sigmask);
- signotify(td);
- PROC_UNLOCK(p);
+ kern_sigprocmask(td, SIG_SETMASK, &uc.uc_sigmask, NULL, 0);
CTR3(KTR_SIG, "sigreturn: return td=%p pc=%#x sp=%#x",
td, uc.uc_mcontext.mc_srr0, uc.uc_mcontext.mc_gpr[1]);
OpenPOWER on IntegriCloud