]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - include/linux/lsm_hooks.h
UBUNTU: SAUCE: LSM stacking: LSM: General stacking
[mirror_ubuntu-bionic-kernel.git] / include / linux / lsm_hooks.h
index 7161d8e7ee79246ffca220805826f883f26d7ddd..8bb315d31bd56483b77d468ba1ab51be63968218 100644 (file)
@@ -1968,6 +1968,21 @@ struct security_hook_list {
        char                            *lsm;
 } __randomize_layout;
 
+/*
+ * 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;
+};
+
 /*
  * Initializing a security_hook_list structure takes
  * up a lot of space in a source file. This macro takes
@@ -1980,6 +1995,7 @@ struct security_hook_list {
 extern struct security_hook_heads security_hook_heads;
 extern char *lsm_names;
 
+extern void security_add_blobs(struct lsm_blob_sizes *needed);
 extern void security_add_hooks(struct security_hook_list *hooks, int count,
                                char *lsm);
 
@@ -2013,7 +2029,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);
@@ -2026,4 +2042,12 @@ void __init loadpin_add_hooks(void);
 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 */