mirror of
https://github.com/opnsense/src.git
synced 2026-06-13 18:50:31 -04:00
exit1: postpone clearing P_TRACED flag until the proctree lock is acquired
In case of the process being debugged. The P_TRACED is cleared very early, which would make procdesc_close() not calling proc_clear_orphan(). That would result in the debugged process can not be able to collect status of the process with process descriptor. Reviewed by: markj, kib Tested by: pho MFC after: 1 month
This commit is contained in:
parent
217c81f334
commit
41fadb3fca
1 changed files with 3 additions and 1 deletions
|
|
@ -355,7 +355,6 @@ exit1(struct thread *td, int rval, int signo)
|
|||
*/
|
||||
PROC_LOCK(p);
|
||||
stopprofclock(p);
|
||||
p->p_flag &= ~(P_TRACED | P_PPWAIT | P_PPTRACE);
|
||||
p->p_ptevents = 0;
|
||||
|
||||
/*
|
||||
|
|
@ -458,6 +457,9 @@ exit1(struct thread *td, int rval, int signo)
|
|||
sx_xunlock(&allproc_lock);
|
||||
|
||||
sx_xlock(&proctree_lock);
|
||||
PROC_LOCK(p);
|
||||
p->p_flag &= ~(P_TRACED | P_PPWAIT | P_PPTRACE);
|
||||
PROC_UNLOCK(p);
|
||||
|
||||
/*
|
||||
* Reparent all children processes:
|
||||
|
|
|
|||
Loading…
Reference in a new issue