mirror of https://github.com/torvalds/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 <keescook@chromium.org> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
This commit is contained in:
parent
5df5bdc3c4
commit
98cfeb8d54
|
|
@ -447,12 +447,6 @@ static int yama_dointvec_minmax(struct ctl_table *table, int write,
|
||||||
|
|
||||||
static int max_scope = YAMA_SCOPE_NO_ATTACH;
|
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[] = {
|
static struct ctl_table yama_sysctl_table[] = {
|
||||||
{
|
{
|
||||||
.procname = "ptrace_scope",
|
.procname = "ptrace_scope",
|
||||||
|
|
@ -467,7 +461,7 @@ static struct ctl_table yama_sysctl_table[] = {
|
||||||
};
|
};
|
||||||
static void __init yama_init_sysctl(void)
|
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");
|
panic("Yama: sysctl registration failed.\n");
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue