From c5e439534a8b493679e517616c631af277fcad26 Mon Sep 17 00:00:00 2001 From: Joel Granados Date: Tue, 23 May 2023 13:15:02 +0200 Subject: [PATCH] sysctl: add missing kernel subdir nodes The "kernel/usermodehelper" and "kernel/keys" paths are directories with sysctl tables of their own; add them to the sysctl_init call. Signed-off-by: Joel Granados Tested-by: Stephen Rothwell --- kernel/sysctl.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/kernel/sysctl.c b/kernel/sysctl.c index fa2aa8bd32b6..73fa9cf7ee11 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -1782,11 +1782,6 @@ static struct ctl_table kern_table[] = { .mode = 0644, .proc_handler = sysctl_max_threads, }, - { - .procname = "usermodehelper", - .mode = 0555, - .child = usermodehelper_table, - }, { .procname = "overflowuid", .data = &overflowuid, @@ -1962,13 +1957,6 @@ static struct ctl_table kern_table[] = { .proc_handler = proc_dointvec, }, #endif -#ifdef CONFIG_KEYS - { - .procname = "keys", - .mode = 0555, - .child = key_sysctls, - }, -#endif #ifdef CONFIG_PERF_EVENTS /* * User-space scripts rely on the existence of this file @@ -2351,6 +2339,11 @@ static struct ctl_table dev_table[] = { int __init sysctl_init_bases(void) { register_sysctl_init("kernel", kern_table); + register_sysctl_init("kernel/usermodehelper", usermodehelper_table); +#ifdef CONFIG_KEYS + register_sysctl_init("kernel/keys", key_sysctls); +#endif + register_sysctl_init("vm", vm_table); register_sysctl_init("debug", debug_table); register_sysctl_init("dev", dev_table); -- 2.30.2