summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_context.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2003-04-17 22:21:57 +0000
committerjhb <jhb@FreeBSD.org>2003-04-17 22:21:57 +0000
commit96015b90e08facc1325dfa510bbe7a265e0118bc (patch)
treefe1491e67e9166459fe18c741883a612388b5b4b /sys/kern/kern_context.c
parente517678fbb354c13b3fc298c6d2f7cd346c99f83 (diff)
downloadFreeBSD-src-96015b90e08facc1325dfa510bbe7a265e0118bc.zip
FreeBSD-src-96015b90e08facc1325dfa510bbe7a265e0118bc.tar.gz
Protect td_sigmask with the proc lock.
Diffstat (limited to 'sys/kern/kern_context.c')
-rw-r--r--sys/kern/kern_context.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/kern/kern_context.c b/sys/kern/kern_context.c
index ffb3f95..653475d 100644
--- a/sys/kern/kern_context.c
+++ b/sys/kern/kern_context.c
@@ -66,13 +66,15 @@ int
getcontext(struct thread *td, struct getcontext_args *uap)
{
ucontext_t uc;
- int ret;
+ int ret;
if (uap->ucp == NULL)
ret = EINVAL;
else {
get_mcontext(td, &uc.uc_mcontext);
+ PROC_LOCK(td->td_proc);
uc.uc_sigmask = td->td_sigmask;
+ PROC_UNLOCK(td->td_proc);
ret = copyout(&uc, uap->ucp, UC_COPY_SIZE);
}
return (ret);
@@ -114,7 +116,9 @@ swapcontext(struct thread *td, struct swapcontext_args *uap)
ret = EINVAL;
else {
get_mcontext(td, &uc.uc_mcontext);
+ PROC_LOCK(td->td_proc);
uc.uc_sigmask = td->td_sigmask;
+ PROC_UNLOCK(td->td_proc);
ret = copyout(&uc, uap->oucp, UC_COPY_SIZE);
if (ret == 0) {
ret = copyin(uap->ucp, &uc, UC_COPY_SIZE);
OpenPOWER on IntegriCloud