[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230302202826.776286-7-mcgrof@kernel.org>
Date: Thu, 2 Mar 2023 12:28:21 -0800
From: Luis Chamberlain <mcgrof@...nel.org>
To: ebiederm@...ssion.com, keescook@...omium.org, yzaikin@...gle.com,
john.johansen@...onical.com, paul@...l-moore.com,
jmorris@...ei.org, serge@...lyn.com, luto@...capital.net,
wad@...omium.org, dverkamp@...omium.org, paulmck@...nel.org,
baihaowen@...zu.com, frederic@...nel.org, jeffxu@...gle.com,
ebiggers@...nel.org, tytso@....edu, guoren@...nel.org
Cc: j.granados@...sung.com, zhangpeng362@...wei.com,
tangmeng@...ontech.com, willy@...radead.org, nixiaoming@...wei.com,
sujiaxun@...ontech.com, patches@...ts.linux.dev,
linux-fsdevel@...r.kernel.org, apparmor@...ts.ubuntu.com,
linux-security-module@...r.kernel.org, linux-csky@...r.kernel.org,
linux-kernel@...r.kernel.org, Luis Chamberlain <mcgrof@...nel.org>
Subject: [PATCH 06/11] yama: simplfy sysctls with register_sysctl()
register_sysctl_paths() is only need if you have directories with
entries, simplify this by using register_sysctl().
Signed-off-by: Luis Chamberlain <mcgrof@...nel.org>
---
security/yama/yama_lsm.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/security/yama/yama_lsm.c b/security/yama/yama_lsm.c
index 06e226166aab..90dd012b0db5 100644
--- a/security/yama/yama_lsm.c
+++ b/security/yama/yama_lsm.c
@@ -447,12 +447,6 @@ static int yama_dointvec_minmax(struct ctl_table *table, int write,
static int max_scope = YAMA_SCOPE_NO_ATTACH;
-static struct ctl_path yama_sysctl_path[] = {
- { .procname = "kernel", },
- { .procname = "yama", },
- { }
-};
-
static struct ctl_table yama_sysctl_table[] = {
{
.procname = "ptrace_scope",
@@ -467,7 +461,7 @@ static struct ctl_table yama_sysctl_table[] = {
};
static void __init yama_init_sysctl(void)
{
- if (!register_sysctl_paths(yama_sysctl_path, yama_sysctl_table))
+ if (!register_sysctl("kernel/yama", yama_sysctl_table))
panic("Yama: sysctl registration failed.\n");
}
#else
--
2.39.1
Powered by blists - more mailing lists