diff options
author | jhb <jhb@FreeBSD.org> | 2003-05-05 21:18:10 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2003-05-05 21:18:10 +0000 |
commit | 099389efb05839cf602e0b1310b9656b5eb9d715 (patch) | |
tree | 9e9765516be75385d4b0cfa9c50e108690e0584b /sys/kern/kern_sig.c | |
parent | 755cc1e549042c3b6c4ba75a7f2315a72b0ac0d7 (diff) | |
download | FreeBSD-src-099389efb05839cf602e0b1310b9656b5eb9d715.zip FreeBSD-src-099389efb05839cf602e0b1310b9656b5eb9d715.tar.gz |
Lock the proc lock around calls to tdsignal() in the sigwait() family of
syscalls.
Diffstat (limited to 'sys/kern/kern_sig.c')
-rw-r--r-- | sys/kern/kern_sig.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index ce5680a..4d2cfa6 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -732,9 +732,11 @@ sigwait(struct thread *td, struct sigwait_args *uap) error = copyout(&info.si_signo, uap->sig, sizeof(info.si_signo)); /* Repost if we got an error. */ - if (error && info.si_signo) + if (error && info.si_signo) { + PROC_LOCK(td->td_proc); tdsignal(td, info.si_signo); - + PROC_UNLOCK(td->td_proc); + } return (error); } /* @@ -768,9 +770,11 @@ sigtimedwait(struct thread *td, struct sigtimedwait_args *uap) error = copyout(&info, uap->info, sizeof(info)); /* Repost if we got an error. */ - if (error && info.si_signo) + if (error && info.si_signo) { + PROC_LOCK(td->td_proc); tdsignal(td, info.si_signo); - + PROC_UNLOCK(td->td_proc); + } return (error); } @@ -794,9 +798,11 @@ sigwaitinfo(struct thread *td, struct sigwaitinfo_args *uap) error = copyout(&info, uap->info, sizeof(info)); /* Repost if we got an error. */ - if (error && info.si_signo) + if (error && info.si_signo) { + PROC_LOCK(td->td_proc); tdsignal(td, info.si_signo); - + PROC_UNLOCK(td->td_proc); + } return (error); } |