summaryrefslogtreecommitdiff
path: root/security
diff options
context:
space:
mode:
authorLuis Chamberlain <mcgrof@kernel.org>2023-03-02 12:28:19 -0800
committerLuis Chamberlain <mcgrof@kernel.org>2023-04-13 11:49:20 -0700
commit96200952abeb35c4407851bfcdcbc144cc0d027d (patch)
treed3766e6426dba814bd168989f082b80ee4abaa52 /security
parent228b09de936395ddd740df3522ea35ae934830d8 (diff)
downloadlinux-96200952abeb35c4407851bfcdcbc144cc0d027d.tar.gz
apparmor: simplify sysctls with register_sysctl_init()
Using register_sysctl_paths() is really only needed if you have subdirectories with entries. We can use the simple register_sysctl() instead. Acked-by: John Johansen <john.johansen@canonical.com> Reviewed-by: Georgia Garcia <georgia.garcia@canonical.com> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
Diffstat (limited to 'security')
-rw-r--r--security/apparmor/lsm.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c
index d6cc4812ca53..47c7ec7e5a80 100644
--- a/security/apparmor/lsm.c
+++ b/security/apparmor/lsm.c
@@ -1764,11 +1764,6 @@ static int apparmor_dointvec(struct ctl_table *table, int write,
return proc_dointvec(table, write, buffer, lenp, ppos);
}
-static struct ctl_path apparmor_sysctl_path[] = {
- { .procname = "kernel", },
- { }
-};
-
static struct ctl_table apparmor_sysctl_table[] = {
{
.procname = "unprivileged_userns_apparmor_policy",
@@ -1790,8 +1785,7 @@ static struct ctl_table apparmor_sysctl_table[] = {
static int __init apparmor_init_sysctl(void)
{
- return register_sysctl_paths(apparmor_sysctl_path,
- apparmor_sysctl_table) ? 0 : -ENOMEM;
+ return register_sysctl("kernel", apparmor_sysctl_table) ? 0 : -ENOMEM;
}
#else
static inline int apparmor_init_sysctl(void)