From nobody Mon Dec 16 14:46:05 2024 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 4YBjRy1tnhz5hWXD; Mon, 16 Dec 2024 14:46:06 +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 4YBjRx6Fv1z4f9r; Mon, 16 Dec 2024 14:46:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734360365; 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=bFAlA/+PuahRpR9WgoqZQEWfwzAf8kJM22YfL4Og8qA=; b=LCVcY8g60gHKz9xXjN89F8A8LT/9WFXcLHP0S20wyKMiQqxT81K8UyWhY6bjAiAxa/UulE QISvBVZbs/R1ztkf7+MASZhn+9rWg6MJnJ+0vMaEnqMkXNwQGjQUZXTr5cADpJEfMmN4fS V/KGlQqHyj831YqCYZq56Qgcg8xOZctwYjb0vob7F+Tq9+ejol/gge0i+EYAX85iQochCR R4PUkx2nlHS0klqlqKzZ+eIR1IwBzgDZ+63RpbPULo1sJcVVftSHxH6UAw6sYLIVj7M4jo J1VEkCqWeLlSF2UDaF5e5Lib8YPMRyBEUPG0iw0keXaHFGrx1nhwuW/On0xl9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734360365; 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=bFAlA/+PuahRpR9WgoqZQEWfwzAf8kJM22YfL4Og8qA=; b=ANfi8Bhw4WbtdlZwN9HLpQ1+AxLhg1f8lfxpBjCgsmpd3zofMVf2OdXIj7jN5qo6VbhoW5 WjeUeQ06ZKVqAs2VYkS8ysU1RX+ungfVLOYN41GcuTRyVHvKU21dVMwEGKlLsVOfN0iFE5 qze0JEn6zId4N/PaI32GGZ1Q+z0Yf+seGp4M8SekoqLDRKGkXGAUIwi4vD83oXKUqb0oeO xeLUvBD85p8tGT97wC7bjfocrX+FdsHLEkWnEBPlYtXSOVQKWc+i//6QyxDjyMlLwqv2yd 1L9FKPYIBlBcT8Zi6B+P8mZ87BKXpMHumOP3bkmclCXpr2fSupDhS7FM1jPIGw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734360365; a=rsa-sha256; cv=none; b=BWFCIt5NcXzfEipIdyZE+GXL+V7ES654Nr7NKwH/BwNIWmI/TWlOWIYGn+TqeayuJKX6yH DEubvaSX9BR2BTb6rsfDh6etJD7RJem42HLj1ps3O5m3eUtJT8EUKo0bahnSPRjaUqxqu+ HUovZ2Xn3PdjsLWt78dHtdCqHiCK3grCHD6PoBLZWegFXWWJChTc1tjNat36FI+9N/UsrA qs1Y1hzVBxNHjsgP9TktPsk/Hrx0OQHe7JxZFNZ65i0r4KeQ4TIF+NzvFJya09sejTa8/k ROckFxKoXQ8Fnk8KcFXGfhmYNcGvFs31Kik88giiKOVM4PIR83q0bUkYCKyx3A== 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 4YBjRx5sstzxYM; Mon, 16 Dec 2024 14:46:05 +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 4BGEk5bW053802; Mon, 16 Dec 2024 14:46:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BGEk5xw053799; Mon, 16 Dec 2024 14:46:05 GMT (envelope-from git) Date: Mon, 16 Dec 2024 14:46:05 GMT Message-Id: <202412161446.4BGEk5xw053799@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: 40a664a463ba - main - MAC/do: Rename private OSD slot by removing 'mac_do_' prefix 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 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: 40a664a463bab87505c8d42816a71202e8ad7bd9 Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=40a664a463bab87505c8d42816a71202e8ad7bd9 commit 40a664a463bab87505c8d42816a71202e8ad7bd9 Author: Olivier Certner AuthorDate: 2024-11-25 15:07:57 +0000 Commit: Olivier Certner CommitDate: 2024-12-16 14:42:38 +0000 MAC/do: Rename private OSD slot by removing 'mac_do_' prefix This variable is static and holds the OSD slot number for jails that MAC/do uses to store rules. In the same vein as previous renames, simplify it by removing the redundant prefix, as this name cannot appear in code outside of 'mac_do.c', nor in stack traces on panic. Reviewed by: bapt Approved by: markj (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D47772 --- sys/security/mac_do/mac_do.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/sys/security/mac_do/mac_do.c b/sys/security/mac_do/mac_do.c index 5bec02ee2e56..fc1a6de471b6 100644 --- a/sys/security/mac_do/mac_do.c +++ b/sys/security/mac_do/mac_do.c @@ -36,7 +36,7 @@ static MALLOC_DEFINE(M_DO, "do_rule", "Rules for mac_do"); #define MAC_RULE_STRING_LEN 1024 -static unsigned mac_do_osd_jail_slot; +static unsigned osd_jail_slot; #define RULE_INVALID 0 /* Must stay 0. */ #define RULE_UID 1 @@ -284,7 +284,7 @@ find_rules(struct prison *const pr, struct prison **const aprp) cpr = pr; for (;;) { prison_lock(cpr); - rules = osd_jail_get(cpr, mac_do_osd_jail_slot); + rules = osd_jail_get(cpr, osd_jail_slot); if (rules != NULL) break; prison_unlock(cpr); @@ -299,7 +299,7 @@ find_rules(struct prison *const pr, struct prison **const aprp) } /* - * OSD destructor for slot 'mac_do_osd_jail_slot'. + * OSD destructor for slot 'osd_jail_slot'. * * Called with 'value' not NULL. */ @@ -317,14 +317,14 @@ dealloc_osd(void *const value) * In practice, this means that the rules become inherited (from the closest * ascendant that has some). * - * Destroys the 'mac_do_osd_jail_slot' slot of the passed jail. + * Destroys the 'osd_jail_slot' slot of the passed jail. */ static void remove_rules(struct prison *const pr) { prison_lock(pr); /* This calls destructor dealloc_osd(). */ - osd_jail_del(pr, mac_do_osd_jail_slot); + osd_jail_del(pr, osd_jail_slot); prison_unlock(pr); } @@ -337,11 +337,11 @@ set_rules(struct prison *const pr, struct rules *const rules) struct rules *old_rules; void **rsv; - rsv = osd_reserve(mac_do_osd_jail_slot); + rsv = osd_reserve(osd_jail_slot); prison_lock(pr); - old_rules = osd_jail_get(pr, mac_do_osd_jail_slot); - osd_jail_set_reserved(pr, mac_do_osd_jail_slot, rsv, rules); + old_rules = osd_jail_get(pr, osd_jail_slot); + osd_jail_set_reserved(pr, osd_jail_slot, rsv, rules); prison_unlock(pr); if (old_rules != NULL) toast_rules(old_rules); @@ -617,7 +617,7 @@ mac_do_init(struct mac_policy_conf *mpc) { struct prison *pr; - mac_do_osd_jail_slot = osd_jail_register(dealloc_osd, osd_methods); + osd_jail_slot = osd_jail_register(dealloc_osd, osd_methods); set_empty_rules(&prison0); sx_slock(&allprison_lock); TAILQ_FOREACH(pr, &allprison, pr_list) @@ -628,7 +628,7 @@ mac_do_init(struct mac_policy_conf *mpc) static void mac_do_destroy(struct mac_policy_conf *mpc) { - osd_jail_deregister(mac_do_osd_jail_slot); + osd_jail_deregister(osd_jail_slot); } static bool