aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorOlivier Certner <olce@FreeBSD.org>2026-04-27 12:16:46 +0000
committerOlivier Certner <olce@FreeBSD.org>2026-05-29 15:21:55 +0000
commitcf942ac9e967055286a7076bf76e9a62e1d22d8f (patch)
treecf8710d0c0bb6bae68bab84a008427d678454c3e /sys
parent28ebab7c3730105f06f982950e9aee4130469906 (diff)
Diffstat (limited to 'sys')
-rw-r--r--sys/security/mac_do/mac_do.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/security/mac_do/mac_do.c b/sys/security/mac_do/mac_do.c
index ab6c21b38063..3d0ce2b49baa 100644
--- a/sys/security/mac_do/mac_do.c
+++ b/sys/security/mac_do/mac_do.c
@@ -1184,7 +1184,15 @@ find_conf(struct prison *const pr, struct prison **const aprp)
prison_unlock(cpr);
ppr = cpr->pr_parent;
- MPASS(ppr != NULL); /* prison0 always has rules. */
+ /*
+ * 'prison0' normally always have a mac_do(4) configuration
+ * because we installed one on module load/activation and
+ * nothing can destroy it as 'prison0' is not a regular jail and
+ * the 'mac.do' parameter cannot be set to 'inherit' on it,
+ * which is the only way to clear an existing configuration.
+ */
+ KASSERT(ppr != NULL,
+ ("MAC/do: 'prison0' must always have a configuration."));
cpr = ppr;
}