From nobody Mon Dec 16 14:45:55 2024 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 4YBjRm2k4Hz5hWLk; Mon, 16 Dec 2024 14:45:56 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YBjRl5qGHz4dYx; Mon, 16 Dec 2024 14:45:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734360355; 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=+HcbE3KVFTfVR63bJxcnhItnn7BbUXU4KT/pGLnF3VI=; b=soXEG1QshjudQzOQZ/u+zIXoiKEhvtwwKnvjuBV9rAJFSRD9HU9VYyjbbdnpnA3EkOp2Rs SxfeDYCY8uhAWPeLD1cuX6CLB8QQ4V8MoHO2eMwZcksnjCZ/guYIjpMwe8FoHNHfCfGaR1 Fp1d9HMNUIcpD5M0rK5ZXueTPWpcEalx8jEqVQbl0E2Hpfmyrl3PALnrA6LCR0oJxAbeLM DV4qjJxhCvp30pVbAUoONWD7Afd3OWrl5TgLlW2sTXD0k6cAaj7OuZpQqG/+SI92SIwzrY mbWeaNBdp9PzuP/QLFfLriybavJGjBBM8xIQO1fqPVjdk4wZCzLIME1uJ01g+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734360355; 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=+HcbE3KVFTfVR63bJxcnhItnn7BbUXU4KT/pGLnF3VI=; b=HOa0n/QVW7DU0B6BMzEsF4spnMlmSa6o54KqImbmVv5PGrDe1fsqYIxTclOjU62jWjMevN nDYw7udfOuXz2QfRmvP46ZQX76bf3Fg+/CEpxABSX5W8E0OhuEgnzM7RJgtea3neXISCaa kwiaUpWoCjzokwiM5/GcMFqcVfxxgE9IY6TaTQNkxlmk0BpBi8JNeQLz1pHAlf0Dn7OT/9 /HVno4ZGyn/3hACHYHees+WHvyCJmYqX0RTCD9/gqc6nQwACn8EnlXCZomxvAburDD8Of2 voHFlW1pwd47l/ktfxZx1lqiaoQnAtK66zaWJt4dsHZrGf3ZS4lqfI4fRTrX2Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734360355; a=rsa-sha256; cv=none; b=BIl1H6WhtNof9VBvzLhCorEIF53+rrFp3P/XCKDHjd+NDkQZNmXC5xeO3x+jWENM3VazZa t52GFP3BrLGWc6ojZh82QlxtX6CNAehedICJhESD2OQ4GrSHbDGUxEOl2feshGwXOafv0U 9r/EhKIIc4WD+/fqy2RDKYSpD+FkD9Lei7K+qlCzcGFfujjJSimCreisEFGGoLZmwOmxrL 7nl43hAADKdUaC0Iy7FTJPOxVu4iQrTY6ota8BHHlBK4gq1rphSDPz4JHvkDluf9YIMBR0 k16ATF+7A+l1HkkMas0lTwMEOEYoLog9bQi6byoaBDWI+ikwa41vF4pLEpCVWg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YBjRl5PwGzxBD; Mon, 16 Dec 2024 14:45:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BGEjtTD053316; Mon, 16 Dec 2024 14:45:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BGEjtkE053313; Mon, 16 Dec 2024 14:45:55 GMT (envelope-from git) Date: Mon, 16 Dec 2024 14:45:55 GMT Message-Id: <202412161445.4BGEjtkE053313@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: 11ba1f2fe2d4 - main - MAC/do: Prefix internal functions used as hooks/callbacks 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 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: 11ba1f2fe2d4e151ffc0a66d03a0691a7b8d2866 Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=11ba1f2fe2d4e151ffc0a66d03a0691a7b8d2866 commit 11ba1f2fe2d4e151ffc0a66d03a0691a7b8d2866 Author: Olivier Certner AuthorDate: 2024-07-30 13:14:02 +0000 Commit: Olivier Certner CommitDate: 2024-12-16 14:42:36 +0000 MAC/do: Prefix internal functions used as hooks/callbacks So that we immediately know whether a kernel stack involves MAC/do. Reviewed by: bapt Approved by: markj (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D47607 --- sys/security/mac_do/mac_do.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/sys/security/mac_do/mac_do.c b/sys/security/mac_do/mac_do.c index 78c05e9be260..a57c29c407b8 100644 --- a/sys/security/mac_do/mac_do.c +++ b/sys/security/mac_do/mac_do.c @@ -309,7 +309,7 @@ parse_and_set_rules(struct prison *const pr, const char *rules_string) } static int -sysctl_rules(SYSCTL_HANDLER_ARGS) +mac_do_sysctl_rules(SYSCTL_HANDLER_ARGS) { char *const buf = malloc(MAC_RULE_STRING_LEN, M_DO, M_WAITOK); struct prison *const td_pr = req->td->td_ucred->cr_prison; @@ -334,7 +334,7 @@ out: SYSCTL_PROC(_security_mac_do, OID_AUTO, rules, CTLTYPE_STRING|CTLFLAG_RW|CTLFLAG_PRISON|CTLFLAG_MPSAFE, - 0, 0, sysctl_rules, "A", + 0, 0, mac_do_sysctl_rules, "A", "Rules"); @@ -445,7 +445,7 @@ static const osd_method_t osd_methods[PR_MAXMETHOD] = { static void -init(struct mac_policy_conf *mpc) +mac_do_init(struct mac_policy_conf *mpc) { struct prison *pr; @@ -458,7 +458,7 @@ init(struct mac_policy_conf *mpc) } static void -destroy(struct mac_policy_conf *mpc) +mac_do_destroy(struct mac_policy_conf *mpc) { osd_jail_deregister(mac_do_osd_jail_slot); } @@ -474,7 +474,7 @@ rule_applies(struct ucred *cred, struct rule *r) } static int -priv_grant(struct ucred *cred, int priv) +mac_do_priv_grant(struct ucred *cred, int priv) { struct rule *r; struct prison *pr; @@ -501,7 +501,7 @@ priv_grant(struct ucred *cred, int priv) } static int -check_setgroups(struct ucred *cred, int ngrp, gid_t *groups) +mac_do_check_setgroups(struct ucred *cred, int ngrp, gid_t *groups) { struct rule *r; char *fullpath = NULL; @@ -535,7 +535,7 @@ check_setgroups(struct ucred *cred, int ngrp, gid_t *groups) } static int -check_setuid(struct ucred *cred, uid_t uid) +mac_do_check_setuid(struct ucred *cred, uid_t uid) { struct rule *r; int error; @@ -590,11 +590,11 @@ check_setuid(struct ucred *cred, uid_t uid) } static struct mac_policy_ops do_ops = { - .mpo_destroy = destroy, - .mpo_init = init, - .mpo_cred_check_setuid = check_setuid, - .mpo_cred_check_setgroups = check_setgroups, - .mpo_priv_grant = priv_grant, + .mpo_destroy = mac_do_destroy, + .mpo_init = mac_do_init, + .mpo_cred_check_setuid = mac_do_check_setuid, + .mpo_cred_check_setgroups = mac_do_check_setgroups, + .mpo_priv_grant = mac_do_priv_grant, }; MAC_POLICY_SET(&do_ops, mac_do, "MAC/do",