summaryrefslogtreecommitdiff
path: root/security
diff options
context:
space:
mode:
authorLuis Chamberlain <mcgrof@kernel.org>2023-03-02 23:28:20 +0300
committerLuis Chamberlain <mcgrof@kernel.org>2023-04-13 21:49:20 +0300
commit5df5bdc3c4733a47a818576c13a7bfd0f0715124 (patch)
treeb47ea3f9e02e2d885fee7d910859ed81e4814443 /security
parent96200952abeb35c4407851bfcdcbc144cc0d027d (diff)
downloadlinux-5df5bdc3c4733a47a818576c13a7bfd0f0715124.tar.xz
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: John Johansen <john.johansen@canonical.com> Acked-by: Kees Cook <keescook@chromium.org> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
Diffstat (limited to 'security')
-rw-r--r--security/loadpin/loadpin.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/security/loadpin/loadpin.c b/security/loadpin/loadpin.c
index d73a281adf86..c971464b4ad5 100644
--- a/security/loadpin/loadpin.c
+++ b/security/loadpin/loadpin.c
@@ -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");