proc: read the pid prior to unlocking in report_alive_proc1

In principle another thread could have reaped the process by that time.
This commit is contained in:
Mateusz Guzik 2022-08-25 17:26:49 +00:00
parent 5d0aebf4fa
commit 49afea1059

View File

@ -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