From: Paul Moore Date: Tue, 18 Feb 2025 22:11:32 +0000 (-0500) Subject: loadpin: move initcalls to the LSM framework X-Git-Tag: v6.19-rc1~191^2~12 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b0374e79a83c89f2a85f39364e215ac749ea2f31;p=thirdparty%2Fkernel%2Fstable.git loadpin: move initcalls to the LSM framework Acked-by: Kees Cook Reviewed-by: John Johansen Signed-off-by: Paul Moore --- diff --git a/security/loadpin/loadpin.c b/security/loadpin/loadpin.c index b9ddf05c5c16..273ffbd6defe 100644 --- a/security/loadpin/loadpin.c +++ b/security/loadpin/loadpin.c @@ -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);