]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blobdiff - security/selinux/hooks.c
UBUNTU: SAUCE: LSM: Create and manage the lsmblob data structure.
[mirror_ubuntu-jammy-kernel.git] / security / selinux / hooks.c
index be04375d85480e20d46ace259b366897d625a76d..c6dac21dac63f6fba84a29da114841f541a2882d 100644 (file)
@@ -7107,6 +7107,11 @@ static int selinux_perf_event_write(struct perf_event *event)
 }
 #endif
 
+static struct lsm_id selinux_lsmid __lsm_ro_after_init = {
+       .lsm  = "selinux",
+       .slot = LSMBLOB_NEEDED
+};
+
 /*
  * IMPORTANT NOTE: When adding new hooks, please be careful to keep this order:
  * 1. any hooks that don't belong to (2.) or (3.) below,
@@ -7420,7 +7425,8 @@ static __init int selinux_init(void)
 
        hashtab_cache_init();
 
-       security_add_hooks(selinux_hooks, ARRAY_SIZE(selinux_hooks), "selinux");
+       security_add_hooks(selinux_hooks, ARRAY_SIZE(selinux_hooks),
+                          &selinux_lsmid);
 
        if (avc_add_callback(selinux_netcache_avc_callback, AVC_CALLBACK_RESET))
                panic("SELinux: Unable to register AVC netcache callback\n");