diff options
author | Kees Cook <keescook@chromium.org> | 2018-09-14 15:26:37 -0700 |
---|---|---|
committer | Kees Cook <keescook@chromium.org> | 2019-01-08 13:18:43 -0800 |
commit | 70b62c25665f636c9f6c700b26af7df296b0887e (patch) | |
tree | 03986a41ef6ecdf30b444124c4ef525365cad3bc /security/loadpin | |
parent | d8e9bbd4fa7f654bd877a312fc4104c6e5e5c6ca (diff) | |
download | lwn-70b62c25665f636c9f6c700b26af7df296b0887e.tar.gz lwn-70b62c25665f636c9f6c700b26af7df296b0887e.zip |
LoadPin: Initialize as ordered LSM
This converts LoadPin from being a direct "minor" LSM into an ordered LSM.
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Casey Schaufler <casey@schaufler-ca.com>
Diffstat (limited to 'security/loadpin')
-rw-r--r-- | security/loadpin/loadpin.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/security/loadpin/loadpin.c b/security/loadpin/loadpin.c index 48f39631b370..055fb0a64169 100644 --- a/security/loadpin/loadpin.c +++ b/security/loadpin/loadpin.c @@ -187,13 +187,19 @@ static struct security_hook_list loadpin_hooks[] __lsm_ro_after_init = { LSM_HOOK_INIT(kernel_load_data, loadpin_load_data), }; -void __init loadpin_add_hooks(void) +static int __init loadpin_init(void) { pr_info("ready to pin (currently %senforcing)\n", enforce ? "" : "not "); security_add_hooks(loadpin_hooks, ARRAY_SIZE(loadpin_hooks), "loadpin"); + return 0; } +DEFINE_LSM(loadpin) = { + .name = "loadpin", + .init = loadpin_init, +}; + /* Should not be mutable after boot, so not listed in sysfs (perm == 0). */ module_param(enforce, int, 0); MODULE_PARM_DESC(enforce, "Enforce module/firmware pinning"); |