]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blobdiff - security/loadpin/loadpin.c
UBUNTU: SAUCE: LSM: Create and manage the lsmblob data structure.
[mirror_ubuntu-jammy-kernel.git] / security / loadpin / loadpin.c
index b12f7d986b1e3bdb04c0c63a36bd200280048802..b569f3bc170bccde34c34ece9178823fb60f0dda 100644 (file)
@@ -192,6 +192,11 @@ static int loadpin_load_data(enum kernel_load_data_id id, bool contents)
        return loadpin_read_file(NULL, (enum kernel_read_file_id) id, contents);
 }
 
+static struct lsm_id loadpin_lsmid __lsm_ro_after_init = {
+       .lsm  = "loadpin",
+       .slot = LSMBLOB_NOT_NEEDED
+};
+
 static struct security_hook_list loadpin_hooks[] __lsm_ro_after_init = {
        LSM_HOOK_INIT(sb_free_security, loadpin_sb_free_security),
        LSM_HOOK_INIT(kernel_read_file, loadpin_read_file),
@@ -239,7 +244,8 @@ static int __init loadpin_init(void)
        pr_info("ready to pin (currently %senforcing)\n",
                enforce ? "" : "not ");
        parse_exclude();
-       security_add_hooks(loadpin_hooks, ARRAY_SIZE(loadpin_hooks), "loadpin");
+       security_add_hooks(loadpin_hooks, ARRAY_SIZE(loadpin_hooks),
+                          &loadpin_lsmid);
        return 0;
 }