From: Luis Chamberlain Date: Thu, 2 Mar 2023 20:28:21 +0000 (-0800) Subject: yama: simplfy sysctls with register_sysctl() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=98cfeb8d540aa009cd5cb973def265b6c44afa00;p=linux.git yama: simplfy sysctls with register_sysctl() register_sysctl_paths() is only need if you have directories with entries, simplify this by using register_sysctl(). Acked-by: Kees Cook Signed-off-by: Luis Chamberlain --- diff --git a/security/yama/yama_lsm.c b/security/yama/yama_lsm.c index 06e226166aab3..90dd012b0db5f 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