ktrace: Fix an inverted comparison added in commit f3851b235

Fixes:		f3851b235 ("ktrace: Fix a race with fork()")
Reported by:	dchagin, phk
This commit is contained in:
Mark Johnston 2021-06-01 09:15:35 -04:00
parent b501b2ae52
commit 283e60fb31

View File

@ -1176,7 +1176,8 @@ ktrops(struct thread *td, struct proc *p, int ops, int facs,
PROC_UNLOCK(p);
return (0);
}
if ((ops == KTROP_SET && p->p_state == PRS_NEW) || !p_cansee(td, p)) {
if ((ops == KTROP_SET && p->p_state == PRS_NEW) ||
p_cansee(td, p) != 0) {
/*
* Disallow setting trace points if the process is being born.
* This avoids races with trace point inheritance in