mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-17 10:26:15 +00:00
Lock the proc lock around calls to tdsignal() in the sigwait() family of
syscalls.
This commit is contained in:
parent
6711f10fb6
commit
18440c7fe7
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=114755
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user