diff --git a/sys/kern/subr_log.c b/sys/kern/subr_log.c --- a/sys/kern/subr_log.c +++ b/sys/kern/subr_log.c @@ -95,6 +95,8 @@ struct proc *p = curproc; KKASSERT(p != NULL); + if (caps_priv_check_td(curthread, SYSCAP_RESTRICTEDROOT)) + return (EPERM); if (atomic_cmpset_int(&log_open, 0, 1) == 0) return (EBUSY); callout_init_mp(&logsoftc.sc_callout);