]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - include/linux/lsm_hooks.h
mod_devicetable: fix PHY module format
[mirror_ubuntu-bionic-kernel.git] / include / linux / lsm_hooks.h
index ab454445673a42108ee6f792cca5e10a8230064b..7ddfb6e999f95295bd3830313b46b77d8e12b6e7 100644 (file)
@@ -1966,14 +1966,35 @@ struct security_hook_list {
        struct list_head                *head;
        union security_list_options     hook;
        char                            *lsm;
+       int                             lsm_index;
 } __randomize_layout;
 
+/*
+ * The maximum number of major security modules.
+ * Used to avoid excessive memory management while
+ * mapping global and module specific secids.
+ *
+ * Currently SELinux, Smack, AppArmor, TOMOYO
+ * Oh, but Casey needs to come up with the right way
+ * to identify a "major" module, so use the total number
+ * of modules (including minor) for now.
+ * Minor: Capability, Yama, LoadPin
+ */
+#define        LSM_MAX_MAJOR   8
+
 /*
  * Security blob size or offset data.
  */
 struct lsm_blob_sizes {
        int     lbs_cred;
        int     lbs_file;
+       int     lbs_inode;
+       int     lbs_ipc;
+       int     lbs_key;
+       int     lbs_msg_msg;
+       int     lbs_sock;
+       int     lbs_superblock;
+       int     lbs_task;
 };
 
 /*
@@ -2022,7 +2043,7 @@ static inline void security_delete_hooks(struct security_hook_list *hooks,
 #define __lsm_ro_after_init    __ro_after_init
 #endif /* CONFIG_SECURITY_WRITABLE_HOOKS */
 
-extern int __init security_module_enable(const char *module);
+extern bool __init security_module_enable(const char *lsm, const bool stacked);
 extern void __init capability_add_hooks(void);
 #ifdef CONFIG_SECURITY_YAMA
 extern void __init yama_add_hooks(void);
@@ -2036,9 +2057,11 @@ static inline void loadpin_add_hooks(void) { };
 #endif
 
 extern int lsm_cred_alloc(struct cred *cred, gfp_t gfp);
+extern int lsm_inode_alloc(struct inode *inode);
 
 #ifdef CONFIG_SECURITY
 void lsm_early_cred(struct cred *cred);
+void lsm_early_inode(struct inode *inode);
 #endif
 
 #endif /* ! __LINUX_LSM_HOOKS_H */