From nobody Mon Dec 16 14:45:56 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 4YBjRn2RKDz5hWRL; Mon, 16 Dec 2024 14:45: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YBjRm6pX8z4dsd; Mon, 16 Dec 2024 14:45:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734360357; 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=UFAqYOmbOMxPGZd10D1F4H2I4UbfDemFya54mRzQIVA=; b=vhL3D2Zk4/BHqwutWwIz7m8p44Aoz7WFCH/piAdHjSEmyghib0sT5ScuOAvjxTRaixhJ1A boUSKBs/UuMoACnfKr3iEpMZD9GwO0GfRtDXWAjtWqSOfM/Xe2h4A5E7sP98FNFNorfnnG Dn1fghsZT020tSMKteHS6vlt76ELxf1ZSOOxqP7O1DnMNPhxsxfawI+5BzBk7j2F2uOHmj ecOUMcLlsOIvXzJbtzR58aLHvLVR/7ezatEnDt9ehaVoodNbttzppOdREBwcU4TN1Kp4rL LpfiHae7ofClWH/DiqL8iPT/Zqyx7d85yq0mMe5aJmMTWE66MvmyqVYXaX8G5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734360357; 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=UFAqYOmbOMxPGZd10D1F4H2I4UbfDemFya54mRzQIVA=; b=XdLQq9nVRl+WP/BQq6ZRSbwBpeUOOaMxLJFnS/aZbbm9qxdLuOjyr8gkpZeMaUBuuIGYXJ pCWWxFlA7xVfghBUhb0vO8xLbqQTo9nBYvv3Wh6GbtaOFo2ZZoHh9NrJshZIPKsZf0N6+D 1ZDWuzcpeSZLMaM6omyHtYZRqT6eHZ9FWCb3TS2OJ3OxuFdAJDTL6pKuwzYKMo7Ib4r1Sm UVoPCZYrmm8LCIcWZLLK6zNaCaXzXDS5G2YOeNcSpZh4XzU9PZG6iLxmVgyFNDL0qoWqhk l+x76YMnbftlBrGZ8beEnAQwUF1x3tkUF5HLNcDWmU4nanYwgxqqGNTySks2aQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734360357; a=rsa-sha256; cv=none; b=fpoDwTdUPOB8lBhj7MxME9OzBw2f1NrTgJsjabVbMAg7ODt6YyMX59zJfpce7ziP8YGxby k3nXmdESQJUXpLlkd3VEy0llPCSeIltavw21c0r+f1Rud9sJJ6qt0P9U7fTq+o9WHhRMju YKXZZsz7LCuKBhgne9IEWTbEFpKZk1eaQC2mX4Dv0RXIFJrUMQ4a1JkvTkdaBdWDFyx4I4 t2EY301ZkvH122RgywBGslqd3nZGzP3XcAhGABpR7CpoPyoz3yr290GyKJ8jUnPADkD6m1 ne4rYlo8twjmDVorI8/fHfMacJswD5kV4IjmNxYlczpYE7xrFuJkTooUx7YldA== 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 4YBjRm65PmzxBF; Mon, 16 Dec 2024 14:45:56 +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 4BGEjuFR053367; Mon, 16 Dec 2024 14:45:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BGEjuCs053364; Mon, 16 Dec 2024 14:45:56 GMT (envelope-from git) Date: Mon, 16 Dec 2024 14:45:56 GMT Message-Id: <202412161445.4BGEjuCs053364@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: f3a06ced2568 - main - MAC/do: Sysctl knobs/jail parameters under MAC's common nodes 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: f3a06ced25681b6da40c652203f882ba18be227d Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=f3a06ced25681b6da40c652203f882ba18be227d commit f3a06ced25681b6da40c652203f882ba18be227d Author: Olivier Certner AuthorDate: 2024-07-04 09:51:00 +0000 Commit: Olivier Certner CommitDate: 2024-12-16 14:42:36 +0000 MAC/do: Sysctl knobs/jail parameters under MAC's common nodes Reviewed by: bapt Approved by: markj (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D47608 --- sys/security/mac_do/mac_do.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/sys/security/mac_do/mac_do.c b/sys/security/mac_do/mac_do.c index a57c29c407b8..6f68a6f62a79 100644 --- a/sys/security/mac_do/mac_do.c +++ b/sys/security/mac_do/mac_do.c @@ -23,8 +23,6 @@ #include -SYSCTL_DECL(_security_mac); - static SYSCTL_NODE(_security_mac, OID_AUTO, do, CTLFLAG_RW|CTLFLAG_MPSAFE, 0, "mac_do policy controls"); @@ -338,8 +336,8 @@ SYSCTL_PROC(_security_mac_do, OID_AUTO, rules, "Rules"); -SYSCTL_JAIL_PARAM_SYS_NODE(mdo, CTLFLAG_RW, "Jail MAC/do parameters"); -SYSCTL_JAIL_PARAM_STRING(_mdo, rules, CTLFLAG_RW, MAC_RULE_STRING_LEN, +SYSCTL_JAIL_PARAM_SYS_SUBNODE(mac, do, CTLFLAG_RW, "Jail MAC/do parameters"); +SYSCTL_JAIL_PARAM_STRING(_mac_do, rules, CTLFLAG_RW, MAC_RULE_STRING_LEN, "Jail MAC/do rules"); @@ -361,10 +359,10 @@ mac_do_jail_get(void *obj, void *data) int jsys, error; rules = find_rules(pr, &ppr); - error = vfs_setopt(opts, "mdo", &jsys, sizeof(jsys)); + error = vfs_setopt(opts, "mac.do", &jsys, sizeof(jsys)); if (error != 0 && error != ENOENT) goto done; - error = vfs_setopts(opts, "mdo.rules", rules->string); + error = vfs_setopts(opts, "mac.do.rules", rules->string); if (error != 0 && error != ENOENT) goto done; prison_unlock(ppr); @@ -380,14 +378,14 @@ mac_do_jail_check(void *obj, void *data) char *rules_string; int error, jsys, len; - error = vfs_copyopt(opts, "mdo", &jsys, sizeof(jsys)); + error = vfs_copyopt(opts, "mac.do", &jsys, sizeof(jsys)); if (error != ENOENT) { if (error != 0) return (error); if (jsys != JAIL_SYS_NEW && jsys != JAIL_SYS_INHERIT) return (EINVAL); } - error = vfs_getopt(opts, "mdo.rules", (void **)&rules_string, &len); + error = vfs_getopt(opts, "mac.do.rules", (void **)&rules_string, &len); if (error != ENOENT) { if (error != 0) return (error); @@ -409,10 +407,10 @@ mac_do_jail_set(void *obj, void *data) char *rules_string; int error, jsys, len; - error = vfs_copyopt(opts, "mdo", &jsys, sizeof(jsys)); + error = vfs_copyopt(opts, "mac.do", &jsys, sizeof(jsys)); if (error == ENOENT) jsys = -1; - error = vfs_getopt(opts, "mdo.rules", (void **)&rules_string, &len); + error = vfs_getopt(opts, "mac.do.rules", (void **)&rules_string, &len); if (error == ENOENT) rules_string = ""; else