From nobody Fri May 29 16:01:35 2026 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4gRp4w0mjCz6flV4 for ; Fri, 29 May 2026 16:01:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gRp4v40Vtz3HP2 for ; Fri, 29 May 2026 16:01:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1780070495; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BdzfrOuC0h1KEOGJx75uOjhe2ykcdvnInCq1Jjj1KKs=; b=dLXEg44+p31nMzPR40NIcXM+wH682tKBbue9xpNajju+FijF0h3GmtneWNgm71bTiNqVia TYXLWWi5GDMtoCXeuJvEOL4FlXtnTUjvblLyMKMC5nM9AlX/0xgB6N8hY1KjkjuPcPzLoe 6D4RHmbbMdTV4cwhKKl4mEd+/QTE5lQEyoJ01h4CjY+ivvq2XOHnm1GZP2wmIbhrVie+VS +wgeRDMk74w6b08bbB9rnAbNfkXyHnMliR5B/ktTqukHSE9W1sqgeKiS+/QPUzeG0uCizq gZLtbCrWRUNguva9A7wcvxenZs5QjUvXKqTs/+eTpocq2RDUeXgKOmAMaY3yUQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1780070495; a=rsa-sha256; cv=none; b=DANhVy2n5ULe9DWbAXL2vJ2biFc+zNkKoavfI6oZePcOIpfjVaYxJSv/01QYPfbpD0y0BY DkAJZvGPsvPc3mY1im2cReJPoL15yiWFwgspjgSupHpR1eliN9W2rQ/7qXo2QIpn4DJRa7 2aCd9topIX4kyIky8EJMhFEG0zLfdBaWkMYZG/tFNrFCKfK7Ii4Gec/oQMQhrqMADZsBDd AJLbJIM8CMCjInJZP8aoauu8YRP68mMwdan7tGaD796T92TbGvGPHCox7zjkrF/91c2xiC teIkq/gk3G8hBdg3dhYRI0xAvJU5G3EkYrAC4Odz0Y+g31H8EoPMthRCX79w5g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1780070495; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BdzfrOuC0h1KEOGJx75uOjhe2ykcdvnInCq1Jjj1KKs=; b=aZG2X6ljh9u+UEhDpFtzqH+js/V1USL3crmLGv/6fmznaoz9a+PH7gHRss8kODvyWFRxXD wepUMRkisPfWQegBr09R5lA8PvSyaFurwZhXqA5HQfvAZ7OntXWLcoW+MJ/vTeXCUNCXhw G4bqvJHZpAo4f0ex2sRb4qaGelsgPgbLX7mGqzbW3JJEGLi9JqVkJQf2s75njQZBPuWtzg 5FLo3IxLLHRWQIiQKqKb1PPCPm/7Xeh9pHXfpPcOUL76yuVto8jJ5uGJF8LY4q/Gv0iBeu 0qHlzb+DTeoLaMkfJb0Y6ezE+I+yydwoh/L5ebsTc8b4q0SJo2KVR9ZUoVojKA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gRp4v3c6tzg9B for ; Fri, 29 May 2026 16:01:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 346b4 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 29 May 2026 16:01:35 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: cf942ac9e967 - main - MAC/do: find_conf(): Turn an MPASS() into a KASSERT() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cf942ac9e967055286a7076bf76e9a62e1d22d8f Auto-Submitted: auto-generated Date: Fri, 29 May 2026 16:01:35 +0000 Message-Id: <6a19b85f.346b4.2d2a568@gitrepo.freebsd.org> The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=cf942ac9e967055286a7076bf76e9a62e1d22d8f commit cf942ac9e967055286a7076bf76e9a62e1d22d8f Author: Olivier Certner AuthorDate: 2026-04-27 12:16:46 +0000 Commit: Olivier Certner CommitDate: 2026-05-29 15:21:55 +0000 MAC/do: find_conf(): Turn an MPASS() into a KASSERT() Turn the pre-existing comment into an assertion message, with an update following the introduction of the "executable paths" feature. Explain in a comment why this situation cannot happen. Without INVARIANTS, such a situation would cause an immediate panic() (NULL is dereferenced in the next iteration of the loop), so leave the check under INVARIANTS only. Reviewed by: bapt MFC after: 1 month Sponsored by: The FreeBSD Foundation Pull Request: https://ron-dev.freebsd.org/FreeBSD/src/pulls/38 --- sys/security/mac_do/mac_do.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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; }