Commit 5df5bdc3 authored by Luis Chamberlain's avatar Luis Chamberlain

loadpin: simplify sysctls use with register_sysctl()

register_sysctl_paths() is not required, we can just use
register_sysctl() with the required path specified.
Reviewed-by: default avatarJohn Johansen <john.johansen@canonical.com>
Acked-by: default avatarKees Cook <keescook@chromium.org>
Signed-off-by: default avatarLuis Chamberlain <mcgrof@kernel.org>
parent 96200952
......@@ -52,12 +52,6 @@ static bool deny_reading_verity_digests;
#endif
#ifdef CONFIG_SYSCTL
static struct ctl_path loadpin_sysctl_path[] = {
{ .procname = "kernel", },
{ .procname = "loadpin", },
{ }
};
static struct ctl_table loadpin_sysctl_table[] = {
{
.procname = "enforce",
......@@ -262,7 +256,7 @@ static int __init loadpin_init(void)
enforce ? "" : "not ");
parse_exclude();
#ifdef CONFIG_SYSCTL
if (!register_sysctl_paths(loadpin_sysctl_path, loadpin_sysctl_table))
if (!register_sysctl("kernel/loadpin", loadpin_sysctl_table))
pr_notice("sysctl registration failed!\n");
#endif
security_add_hooks(loadpin_hooks, ARRAY_SIZE(loadpin_hooks), "loadpin");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment