aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2024-08-07 13:38:54 +0000
committerMark Johnston <markj@FreeBSD.org>2024-08-07 13:43:35 +0000
commitc39fb98e47400b0808a49628d0c57489e8a5a8ee (patch)
treed5ea091d614abafb02b758d504cdaa343bb74cfe
parentca9580967e7406bb23aa482f94a3c6a02ecbe6a1 (diff)
ktrace: Fix an inverted privilege check
Approved by: so Security: FreeBSD-SA-24:06.ktrace Security: CVE-2024-6760 Fixes: 1762f674ccb5 ("ktrace: pack all ktrace parameters into allocated structure ktr_io_params") (cherry picked from commit 166b7573b5220aadf8b02a85933c9651b909b309) (cherry picked from commit 8b400c8488f0b9e67ae269f6d8e5022a3bc7d854)
-rw-r--r--sys/kern/kern_ktrace.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/kern/kern_ktrace.c b/sys/kern/kern_ktrace.c
index 01158c2c238f..196450af2c84 100644
--- a/sys/kern/kern_ktrace.c
+++ b/sys/kern/kern_ktrace.c
@@ -593,7 +593,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);