ktrace: Fix an inverted privilege check

Approved by:	so
Security:	FreeBSD-24:06.ktrace
Security:	CVE-2024-6760
Fixes:	1762f674cc ("ktrace: pack all ktrace parameters into allocated structure ktr_io_params")
This commit is contained in:
Mark Johnston 2024-08-07 13:38:54 +00:00
parent 0c00dbfeb0
commit 166b7573b5

View File

@ -591,7 +591,7 @@ ktrprocexec(struct proc *p)
PROC_LOCK_ASSERT(p, MA_OWNED);
kiop = p->p_ktrioparms;
if (kiop == NULL || priv_check_cred(kiop->cr, PRIV_DEBUG_DIFFCRED))
if (kiop == NULL || priv_check_cred(kiop->cr, PRIV_DEBUG_DIFFCRED) == 0)
return (NULL);
mtx_lock(&ktrace_mtx);