From nobody Mon Jun 29 19:25:56 2026 X-Original-To: dev-commits-src-all@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 4gpx8P3P1nz6jjTy for ; Mon, 29 Jun 2026 19:25:57 +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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gpx8N5g5Kz40XL for ; Mon, 29 Jun 2026 19:25:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782761156; 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=cp9QO4815E4Ekn2dxNaB65xCjDebw7VODAmw+PkSESs=; b=PlpxpMooRq4I9Qg6NJtpdMqpJUx0VJQMrTQlitCO5LcrZ8NDs07QB0EJkqqID4PbpTM28J mlCx5r0zQXRKBvqFv4LVTH3iHVcr8f6EDI+QeneTfUfnmf9MD+hzQKwtnUeToqzGQbIUjJ o98nKmywf11lh5bWQ71ZwDvrVQR8yhbqo54c70Ex0lvINF8s86Y3ScZPfiHqAY3uyfiD+f GQlQl013MBkiQNu3gSOzGCN7Ma2FZiROGdrFxQ/KxsYrrwFn1DJRFs+Hs6DlEzvQaiiGL1 TqK94OxkzPU9oi1iIU3EQ/+oxoaFBrCe8ivMVpWCtBYJ7X4RqWX04aWM2PUYeg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1782761156; a=rsa-sha256; cv=none; b=ph7Na+M0+afJ/WpLc3QTI3amHa3XzGpHVhGKaAie3BW7qDO4pU3ShFUYOFXU7K6L1Ei25p Jo+3ICrn18Di9D8PsOYGfd3DL5LYi7epkQ4SRpB+pa6uqt82RyFcKTXBpMfLAexKnPBCug onTjkyH2XAcStlSyBJNUGkUJJiI7nNtZ3y3x4ZFY8ZBFXpVN2WcBp3QvJJgf39MB5FmTJA +wz2Uu9c9+doj4oIBm8y3sQLBFKoSri9IEfmpy6zzmTkGOkMDLWxglzz+W9WmhqVJ3xXQU 2+cjIqa5b/3xt32XEepgt7fY4bzX+TKfiriAg98l5VAPewn1qBqkoqj2iNdgug== 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=1782761156; 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=cp9QO4815E4Ekn2dxNaB65xCjDebw7VODAmw+PkSESs=; b=eugEQvwRnJmgGkZEz+W7U5V81pE5XcHhL99M1/GQCd1ErGhqpCLeNQUyBSjR97SwtEEWrM LcBHKdq4HgdHtwTe2n80ytjtpEN30pELxdUtyLRruDrFjUkVAPW10i5ZNxO4KWVcgn6j8+ S4o2FN6ZtgDwg04JqaCOj0N06t7e48sdIeNOQ9+pEr2TnJII06S5RoNYQ1wvbwRxKIAFyb bcTuVcepni9rWc6D7ukU3B7wlee/lF5kUDef4CT3+Rg3NQN7J7mUKNWTG820uNRcIWyJQO sJ4YLeMj2VIac8TK+CMjjXMwI0SSGlJlRYFpCsLi1N4qcRngUOBTwSdRB9QFZw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gpx8N4R1Jz19Np for ; Mon, 29 Jun 2026 19:25:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 21d89 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 29 Jun 2026 19:25:56 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 31d9802ec2b7 - stable/15 - MAC/do: Configuration: Fix default values: Remove jail creation method List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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/stable/15 X-Git-Reftype: branch X-Git-Commit: 31d9802ec2b7f12cc187209fd4fbe6ffc3ccae16 Auto-Submitted: auto-generated Date: Mon, 29 Jun 2026 19:25:56 +0000 Message-Id: <6a42c6c4.21d89.6288bc41@gitrepo.freebsd.org> The branch stable/15 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=31d9802ec2b7f12cc187209fd4fbe6ffc3ccae16 commit 31d9802ec2b7f12cc187209fd4fbe6ffc3ccae16 Author: Olivier Certner AuthorDate: 2026-04-28 13:10:14 +0000 Commit: Olivier Certner CommitDate: 2026-06-29 19:23:50 +0000 MAC/do: Configuration: Fix default values: Remove jail creation method mac_do_jail_create() would create a default configuration on the just-created jail, erroneously causing mac_do_jail_set() to then retrieve it and use it as a model when determining the default values for not-specified parameters, instead of using the configuration applicable to the parent jail. Setting a default configuration in mac_do_jail_create() had been done as a kind of defensive measure to prevent a created jail not to have a configuration (effectively making it inherit from an ancestor jail, which is a security hazard except if explicitly requested). However, this measure was never really effective (osd_jail_call(PR_METHOD_CREATE) in kern_jail_set() calls the PR_PETHOD_CREATE methods in an unspecified order, and stops at the first error), so we are forced to rely in any case on the fact that an error in a PR_METHOD_CREATE or PR_METHOD_SET method leads to stopping the jail creation process (which is the case today; see kern_jail_set()). Reviewed by: bapt Fixes: 9818224174c4 ("MAC/do: Executable paths feature (GSoC 2025's final state)") MFC after: 1 month Sponsored by: The FreeBSD Foundation Pull Request: https://ron-dev.freebsd.org/FreeBSD/src/pulls/38 (cherry picked from commit 51cc5840b66c9565e1740c1198a0e684d81e3734) --- sys/security/mac_do/mac_do.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/sys/security/mac_do/mac_do.c b/sys/security/mac_do/mac_do.c index 126feba135c2..33e655a854a4 100644 --- a/sys/security/mac_do/mac_do.c +++ b/sys/security/mac_do/mac_do.c @@ -1550,16 +1550,6 @@ SYSCTL_PROC(_security_mac_do, OID_AUTO, exec_paths, SYSCTL_JAIL_PARAM_STRING(_mac_do, exec_paths, CTLFLAG_RW, MAX_EXEC_PATHS_SIZE, "Jail MAC/do executable paths"); -static int -mac_do_jail_create(void *obj, void *data) -{ - struct prison *const pr = obj; - - set_default_conf(pr); - - return (0); -} - static int mac_do_jail_get(void *obj, void *data) { @@ -1881,12 +1871,14 @@ mac_do_jail_set(void *obj, void *data) /* * OSD jail methods. * - * There is no PR_METHOD_REMOVE, as OSD storage is destroyed by the common jail - * code (see prison_cleanup()), which triggers a run of our dealloc_jail_osd() - * destructor. + * There is no PR_METHOD_REMOVE method, as OSD storage is destroyed by the + * common jail code (see prison_cleanup()), which triggers a run of our + * dealloc_jail_osd() destructor. There is neither a PR_METHOD_CREATE as + * PR_METHOD_SET is called just after (or the created jail destroyed if some + * PR_METHOD_CREATE fails), and our mac_do_jail_set() will ensure a jail is + * properly configured. */ static const osd_method_t osd_methods[PR_MAXMETHOD] = { - [PR_METHOD_CREATE] = mac_do_jail_create, [PR_METHOD_GET] = mac_do_jail_get, [PR_METHOD_CHECK] = mac_do_jail_check, [PR_METHOD_SET] = mac_do_jail_set,