Skip to content

Commit b0374e7

Browse files
committed
loadpin: move initcalls to the LSM framework
Acked-by: Kees Cook <kees@kernel.org> Reviewed-by: John Johansen <john.johhansen@canonical.com> Signed-off-by: Paul Moore <paul@paul-moore.com>
1 parent cdc0288 commit b0374e7

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

security/loadpin/loadpin.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -270,11 +270,6 @@ static int __init loadpin_init(void)
270270
return 0;
271271
}
272272

273-
DEFINE_LSM(loadpin) = {
274-
.id = &loadpin_lsmid,
275-
.init = loadpin_init,
276-
};
277-
278273
#ifdef CONFIG_SECURITY_LOADPIN_VERITY
279274

280275
enum loadpin_securityfs_interface_index {
@@ -434,9 +429,15 @@ static int __init init_loadpin_securityfs(void)
434429
return 0;
435430
}
436431

437-
fs_initcall(init_loadpin_securityfs);
432+
#endif /* CONFIG_SECURITY_LOADPIN_VERITY */
438433

434+
DEFINE_LSM(loadpin) = {
435+
.id = &loadpin_lsmid,
436+
.init = loadpin_init,
437+
#ifdef CONFIG_SECURITY_LOADPIN_VERITY
438+
.initcall_fs = init_loadpin_securityfs,
439439
#endif /* CONFIG_SECURITY_LOADPIN_VERITY */
440+
};
440441

441442
/* Should not be mutable after boot, so not listed in sysfs (perm == 0). */
442443
module_param(enforce, int, 0);

0 commit comments

Comments
 (0)