Thread (28 messages) 28 messages, 7 authors, 2023-03-19
STALE1183d

[PATCH 05/11] loadpin: simplify sysctls use with register_sysctl()

From: Luis Chamberlain <mcgrof@kernel.org>
Date: 2023-03-02 20:29:52
Also in: linux-fsdevel, linux-patches, lkml
Subsystem: loadpin security module, security subsystem, the rest · Maintainers: Kees Cook, Paul Moore, James Morris, "Serge E. Hallyn", Linus Torvalds

register_sysctl_paths() is not required, we can just use
register_sysctl() with the required path specified.

Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
---
 security/loadpin/loadpin.c | 8 +-------
 1 file changed, 1 insertion(+), 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");
-- 
2.39.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help