From nobody Fri May 29 16:01:36 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 4gRp4x1hRJz6flF3 for ; Fri, 29 May 2026 16:01:37 +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 4gRp4w56gbz3HTt for ; Fri, 29 May 2026 16:01:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1780070496; 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=QjUCqDLr2bG6q3GqBtkL4/0s6O8RtdT7aDxuryyPqIc=; b=ATJY23Gc/biYO6eiDFcmskKxdoRLQtwZz5PhEZpKSlbmM/lmgH1cWEaNNVYktA7kdhcqko cS7/4XrILm3Hq3xsjI7NP/XHucYqJU9EmFB7jf4hMf/DhCa0Cb6IAuM1JVt7+IjSU8sFCV z0sqz/bc4iJlQxZA07t6qyCa189+GzRjAlo6if3fStFct/r0Olz7bezYUQDE0h+rqKPr05 PYoltxFgxFwyk5zt70r+E9X2/7i65fUqhhe47jxUwkCWpQpf0P0FLYy435TkhsgXn4fSYl R54J82Q2BwxskhkhsuDfmhm7tM0vho+d/s9nzGGYyGmAmCBIW6CKZhJLx17kdQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1780070496; a=rsa-sha256; cv=none; b=ZWDUkahA7yhYyRpQl9IWrDD7AMSLth99DSkNc8pJOBSTCHufP/QUHbFGkjV7WkN84JOBCF 6TJENl/DyUt1BVOjx6aaoR0DPpHf0sgcVVw80coyEjmUwqeGPodISOE0IzkRLumJNVzIMs tZtdTsP7ub5J+tNYUb37w+RARvU8cpiqCxeJn9Z3WrI9YJ+21IPM4zf6V8FecoCOWxTaY3 7EwuQ3ukNSM90whSlRR+w4zh0a5d6p4SwwrN9u+5DEWvKcx4U2uP0OTxfdobqsBlvrqrt5 v51oneLTLIp/mComP0TSZNkordr7tuXD2/osFUUkO3wkYOfTP/twelKA7ap8kA== 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=1780070496; 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=QjUCqDLr2bG6q3GqBtkL4/0s6O8RtdT7aDxuryyPqIc=; b=wUk93CZ3me2NW4VpYE0PVUJ/UCPzIi8uE4M5mQ9SxB4rzp/MsMvAacvQpLf2R/VUAj1Aik yXDhmJEPrdFxUKYoAsZALpduX3a0lTmuHIhQva34TGZ9zEN7wuzhVc7mUrlgsIps26Qmhv CFJldPgoV2rmJAL7Cb7qEG7GkFWK4GJgIo0rJJhXUz8XLVDYQGKuV8Lqz565wSRlcnflsg /PFyb6VuvjkgkloKibmkkZ2kANWZ7+tn7G+ju8qIKIkQ2UXCxLLPcHWoMVaomnxd/DyVy/ 0uYpW/5SV09y+bFQELhNBAEXdPoDGdPqz2CYeLfWFdAp0sSwfHqt25bk2QERFw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gRp4w4YrWzg6W for ; Fri, 29 May 2026 16:01:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 367a2 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 29 May 2026 16:01:36 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: cd1ac0440935 - main - MAC/do: Move hold_conf() and drop_conf() earlier 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: cd1ac04409359ec1357e23752f20b22f5055ddfa Auto-Submitted: auto-generated Date: Fri, 29 May 2026 16:01:36 +0000 Message-Id: <6a19b860.367a2.539585dc@gitrepo.freebsd.org> The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=cd1ac04409359ec1357e23752f20b22f5055ddfa commit cd1ac04409359ec1357e23752f20b22f5055ddfa Author: Olivier Certner AuthorDate: 2026-04-27 12:55:05 +0000 Commit: Olivier Certner CommitDate: 2026-05-29 15:22:01 +0000 MAC/do: Move hold_conf() and drop_conf() earlier This is in preparation for using hold_conf() in find_conf(). 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 | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/sys/security/mac_do/mac_do.c b/sys/security/mac_do/mac_do.c index 3d0ce2b49baa..cb351cef15ce 100644 --- a/sys/security/mac_do/mac_do.c +++ b/sys/security/mac_do/mac_do.c @@ -1160,6 +1160,21 @@ error: goto out; } +static void +hold_conf(struct conf *const conf) +{ + refcount_acquire(&conf->use_count); +} + +static void +drop_conf(struct conf *const conf) +{ + if (refcount_release(&conf->use_count)) { + toast_rules(&conf->rules); + free(conf, M_MAC_DO); + } +} + /* * Find configuration applicable to the passed prison. * @@ -1200,21 +1215,6 @@ find_conf(struct prison *const pr, struct prison **const aprp) return (conf); } -static void -hold_conf(struct conf *const conf) -{ - refcount_acquire(&conf->use_count); -} - -static void -drop_conf(struct conf *const conf) -{ - if (refcount_release(&conf->use_count)) { - toast_rules(&conf->rules); - free(conf, M_MAC_DO); - } -} - #ifdef INVARIANTS static void check_conf_use_count(const struct conf *const conf, u_int expected)