- Proper locking for p_tracep and p_traceflag.
- Catch up to new ktrace API.
This commit is contained in:
parent
6c84de02e0
commit
af300f2367
@ -597,15 +597,16 @@ again:
|
|||||||
|
|
||||||
#ifdef KTRACE
|
#ifdef KTRACE
|
||||||
/*
|
/*
|
||||||
* Copy traceflag and tracefile if enabled. If not inherited,
|
* Copy traceflag and tracefile if enabled.
|
||||||
* these were zeroed above but we still could have a trace race
|
|
||||||
* so make sure p2's p_tracep is NULL.
|
|
||||||
*/
|
*/
|
||||||
if ((p1->p_traceflag & KTRFAC_INHERIT) && p2->p_tracep == NULL) {
|
mtx_lock(&ktrace_mtx);
|
||||||
|
KASSERT(p2->p_tracep == NULL, ("new process has a ktrace vnode"));
|
||||||
|
if (p1->p_traceflag & KTRFAC_INHERIT) {
|
||||||
p2->p_traceflag = p1->p_traceflag;
|
p2->p_traceflag = p1->p_traceflag;
|
||||||
if ((p2->p_tracep = p1->p_tracep) != NULL)
|
if ((p2->p_tracep = p1->p_tracep) != NULL)
|
||||||
VREF(p2->p_tracep);
|
VREF(p2->p_tracep);
|
||||||
}
|
}
|
||||||
|
mtx_unlock(&ktrace_mtx);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -861,9 +862,8 @@ fork_return(td, frame)
|
|||||||
|
|
||||||
userret(td, frame, 0);
|
userret(td, frame, 0);
|
||||||
#ifdef KTRACE
|
#ifdef KTRACE
|
||||||
if (KTRPOINT(td->td_proc, KTR_SYSRET)) {
|
if (KTRPOINT(td, KTR_SYSRET))
|
||||||
ktrsysret(td->td_proc->p_tracep, SYS_fork, 0, 0);
|
ktrsysret(SYS_fork, 0, 0);
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
mtx_assert(&Giant, MA_NOTOWNED);
|
mtx_assert(&Giant, MA_NOTOWNED);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user