]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
loadpin: move initcalls to the LSM framework
authorPaul Moore <paul@paul-moore.com>
Tue, 18 Feb 2025 22:11:32 +0000 (17:11 -0500)
committerPaul Moore <paul@paul-moore.com>
Wed, 22 Oct 2025 23:24:25 +0000 (19:24 -0400)
Acked-by: Kees Cook <kees@kernel.org>
Reviewed-by: John Johansen <john.johhansen@canonical.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
security/loadpin/loadpin.c

index b9ddf05c5c16f8d04d4e5a861d418514d58fb42c..273ffbd6defe1324d6688dec5f9fe6c9401283ed 100644 (file)
@@ -270,11 +270,6 @@ static int __init loadpin_init(void)
        return 0;
 }
 
-DEFINE_LSM(loadpin) = {
-       .id = &loadpin_lsmid,
-       .init = loadpin_init,
-};
-
 #ifdef CONFIG_SECURITY_LOADPIN_VERITY
 
 enum loadpin_securityfs_interface_index {
@@ -434,9 +429,15 @@ static int __init init_loadpin_securityfs(void)
        return 0;
 }
 
-fs_initcall(init_loadpin_securityfs);
+#endif /* CONFIG_SECURITY_LOADPIN_VERITY */
 
+DEFINE_LSM(loadpin) = {
+       .id = &loadpin_lsmid,
+       .init = loadpin_init,
+#ifdef CONFIG_SECURITY_LOADPIN_VERITY
+       .initcall_fs = init_loadpin_securityfs,
 #endif /* CONFIG_SECURITY_LOADPIN_VERITY */
+};
 
 /* Should not be mutable after boot, so not listed in sysfs (perm == 0). */
 module_param(enforce, int, 0);