aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMateusz Guzik <mjg@FreeBSD.org>2022-08-25 17:26:49 +0000
committerMateusz Guzik <mjg@FreeBSD.org>2022-08-25 17:26:49 +0000
commit49afea10591249b6cb73ea1c51a28d2334d7dd52 (patch)
tree0681a499da98a544510b79dcd2399b4b321d0fae
parent5d0aebf4fa6d85a2166dcb682f4a71cdd113c383 (diff)
downloadsrc-49afea10591249b6cb73ea1c51a28d2334d7dd52.tar.gz
src-49afea10591249b6cb73ea1c51a28d2334d7dd52.zip
proc: read the pid prior to unlocking in report_alive_proc1
In principle another thread could have reaped the process by that time.
-rw-r--r--sys/kern/kern_exit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c
index cb51193a26e0..4cf31aa73e56 100644
--- a/sys/kern/kern_exit.c
+++ b/sys/kern/kern_exit.c
@@ -1269,8 +1269,8 @@ report_alive_proc(struct thread *td, struct proc *p, siginfo_t *siginfo,
}
if (status != NULL)
*status = cont ? SIGCONT : W_STOPCODE(p->p_xsig);
- PROC_UNLOCK(p);
td->td_retval[0] = p->p_pid;
+ PROC_UNLOCK(p);
}
int