mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-29 05:44:11 +00:00
seccomp: simplify sysctls with register_sysctl_init()
register_sysctl_paths() is only needed if you have childs (directories) with entries. Just use register_sysctl_init() as it also does the kmemleak check for you. Acked-by: Kees Cook <keescook@chromium.org> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
This commit is contained in:
parent
98cfeb8d54
commit
02a6b455fb
1 changed files with 1 additions and 14 deletions
|
@ -2368,12 +2368,6 @@ static int seccomp_actions_logged_handler(struct ctl_table *ro_table, int write,
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct ctl_path seccomp_sysctl_path[] = {
|
|
||||||
{ .procname = "kernel", },
|
|
||||||
{ .procname = "seccomp", },
|
|
||||||
{ }
|
|
||||||
};
|
|
||||||
|
|
||||||
static struct ctl_table seccomp_sysctl_table[] = {
|
static struct ctl_table seccomp_sysctl_table[] = {
|
||||||
{
|
{
|
||||||
.procname = "actions_avail",
|
.procname = "actions_avail",
|
||||||
|
@ -2392,14 +2386,7 @@ static struct ctl_table seccomp_sysctl_table[] = {
|
||||||
|
|
||||||
static int __init seccomp_sysctl_init(void)
|
static int __init seccomp_sysctl_init(void)
|
||||||
{
|
{
|
||||||
struct ctl_table_header *hdr;
|
register_sysctl_init("kernel/seccomp", seccomp_sysctl_table);
|
||||||
|
|
||||||
hdr = register_sysctl_paths(seccomp_sysctl_path, seccomp_sysctl_table);
|
|
||||||
if (!hdr)
|
|
||||||
pr_warn("sysctl registration failed\n");
|
|
||||||
else
|
|
||||||
kmemleak_not_leak(hdr);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue