1 /* SPDX-License-Identifier: GPL-2.0 */ 1 /* SPDX-License-Identifier: GPL-2.0 */ 2 2 3 /* 3 /* 4 * Linux Security Module Hook declarations. 4 * Linux Security Module Hook declarations. 5 * 5 * 6 * Copyright (C) 2001 WireX Communications, In 6 * Copyright (C) 2001 WireX Communications, Inc <chris@wirex.com> 7 * Copyright (C) 2001 Greg Kroah-Hartman <greg 7 * Copyright (C) 2001 Greg Kroah-Hartman <greg@kroah.com> 8 * Copyright (C) 2001 Networks Associates Tech 8 * Copyright (C) 2001 Networks Associates Technology, Inc <ssmalley@nai.com> 9 * Copyright (C) 2001 James Morris <jmorris@in 9 * Copyright (C) 2001 James Morris <jmorris@intercode.com.au> 10 * Copyright (C) 2001 Silicon Graphics, Inc. ( 10 * Copyright (C) 2001 Silicon Graphics, Inc. (Trust Technology Group) 11 * Copyright (C) 2015 Intel Corporation. 11 * Copyright (C) 2015 Intel Corporation. 12 * Copyright (C) 2015 Casey Schaufler <casey@s 12 * Copyright (C) 2015 Casey Schaufler <casey@schaufler-ca.com> 13 * Copyright (C) 2016 Mellanox Techonologies 13 * Copyright (C) 2016 Mellanox Techonologies 14 * Copyright (C) 2020 Google LLC. 14 * Copyright (C) 2020 Google LLC. 15 */ 15 */ 16 16 17 /* 17 /* 18 * The macro LSM_HOOK is used to define the da 18 * The macro LSM_HOOK is used to define the data structures required by 19 * the LSM framework using the pattern: 19 * the LSM framework using the pattern: 20 * 20 * 21 * LSM_HOOK(<return_type>, <default_value 21 * LSM_HOOK(<return_type>, <default_value>, <hook_name>, args...) 22 * 22 * 23 * struct security_hook_heads { 23 * struct security_hook_heads { 24 * #define LSM_HOOK(RET, DEFAULT, NAME, ...) 24 * #define LSM_HOOK(RET, DEFAULT, NAME, ...) struct hlist_head NAME; 25 * #include <linux/lsm_hook_defs.h> 25 * #include <linux/lsm_hook_defs.h> 26 * #undef LSM_HOOK 26 * #undef LSM_HOOK 27 * }; 27 * }; 28 */ 28 */ 29 LSM_HOOK(int, 0, binder_set_context_mgr, const 29 LSM_HOOK(int, 0, binder_set_context_mgr, const struct cred *mgr) 30 LSM_HOOK(int, 0, binder_transaction, const str 30 LSM_HOOK(int, 0, binder_transaction, const struct cred *from, 31 const struct cred *to) 31 const struct cred *to) 32 LSM_HOOK(int, 0, binder_transfer_binder, const 32 LSM_HOOK(int, 0, binder_transfer_binder, const struct cred *from, 33 const struct cred *to) 33 const struct cred *to) 34 LSM_HOOK(int, 0, binder_transfer_file, const s 34 LSM_HOOK(int, 0, binder_transfer_file, const struct cred *from, 35 const struct cred *to, const struct f 35 const struct cred *to, const struct file *file) 36 LSM_HOOK(int, 0, ptrace_access_check, struct t 36 LSM_HOOK(int, 0, ptrace_access_check, struct task_struct *child, 37 unsigned int mode) 37 unsigned int mode) 38 LSM_HOOK(int, 0, ptrace_traceme, struct task_s 38 LSM_HOOK(int, 0, ptrace_traceme, struct task_struct *parent) 39 LSM_HOOK(int, 0, capget, const struct task_str 39 LSM_HOOK(int, 0, capget, const struct task_struct *target, kernel_cap_t *effective, 40 kernel_cap_t *inheritable, kernel_cap 40 kernel_cap_t *inheritable, kernel_cap_t *permitted) 41 LSM_HOOK(int, 0, capset, struct cred *new, con 41 LSM_HOOK(int, 0, capset, struct cred *new, const struct cred *old, 42 const kernel_cap_t *effective, const 42 const kernel_cap_t *effective, const kernel_cap_t *inheritable, 43 const kernel_cap_t *permitted) 43 const kernel_cap_t *permitted) 44 LSM_HOOK(int, 0, capable, const struct cred *c 44 LSM_HOOK(int, 0, capable, const struct cred *cred, struct user_namespace *ns, 45 int cap, unsigned int opts) 45 int cap, unsigned int opts) 46 LSM_HOOK(int, 0, quotactl, int cmds, int type, 46 LSM_HOOK(int, 0, quotactl, int cmds, int type, int id, const struct super_block *sb) 47 LSM_HOOK(int, 0, quota_on, struct dentry *dent 47 LSM_HOOK(int, 0, quota_on, struct dentry *dentry) 48 LSM_HOOK(int, 0, syslog, int type) 48 LSM_HOOK(int, 0, syslog, int type) 49 LSM_HOOK(int, 0, settime, const struct timespe 49 LSM_HOOK(int, 0, settime, const struct timespec64 *ts, 50 const struct timezone *tz) 50 const struct timezone *tz) 51 LSM_HOOK(int, 0, vm_enough_memory, struct mm_s 51 LSM_HOOK(int, 0, vm_enough_memory, struct mm_struct *mm, long pages) 52 LSM_HOOK(int, 0, bprm_creds_for_exec, struct l 52 LSM_HOOK(int, 0, bprm_creds_for_exec, struct linux_binprm *bprm) 53 LSM_HOOK(int, 0, bprm_creds_from_file, struct 53 LSM_HOOK(int, 0, bprm_creds_from_file, struct linux_binprm *bprm, const struct file *file) 54 LSM_HOOK(int, 0, bprm_check_security, struct l 54 LSM_HOOK(int, 0, bprm_check_security, struct linux_binprm *bprm) 55 LSM_HOOK(void, LSM_RET_VOID, bprm_committing_c 55 LSM_HOOK(void, LSM_RET_VOID, bprm_committing_creds, const struct linux_binprm *bprm) 56 LSM_HOOK(void, LSM_RET_VOID, bprm_committed_cr 56 LSM_HOOK(void, LSM_RET_VOID, bprm_committed_creds, const struct linux_binprm *bprm) 57 LSM_HOOK(int, 0, fs_context_submount, struct f 57 LSM_HOOK(int, 0, fs_context_submount, struct fs_context *fc, struct super_block *reference) 58 LSM_HOOK(int, 0, fs_context_dup, struct fs_con 58 LSM_HOOK(int, 0, fs_context_dup, struct fs_context *fc, 59 struct fs_context *src_sc) 59 struct fs_context *src_sc) 60 LSM_HOOK(int, -ENOPARAM, fs_context_parse_para 60 LSM_HOOK(int, -ENOPARAM, fs_context_parse_param, struct fs_context *fc, 61 struct fs_parameter *param) 61 struct fs_parameter *param) 62 LSM_HOOK(int, 0, sb_alloc_security, struct sup 62 LSM_HOOK(int, 0, sb_alloc_security, struct super_block *sb) 63 LSM_HOOK(void, LSM_RET_VOID, sb_delete, struct 63 LSM_HOOK(void, LSM_RET_VOID, sb_delete, struct super_block *sb) 64 LSM_HOOK(void, LSM_RET_VOID, sb_free_security, 64 LSM_HOOK(void, LSM_RET_VOID, sb_free_security, struct super_block *sb) 65 LSM_HOOK(void, LSM_RET_VOID, sb_free_mnt_opts, 65 LSM_HOOK(void, LSM_RET_VOID, sb_free_mnt_opts, void *mnt_opts) 66 LSM_HOOK(int, 0, sb_eat_lsm_opts, char *orig, 66 LSM_HOOK(int, 0, sb_eat_lsm_opts, char *orig, void **mnt_opts) 67 LSM_HOOK(int, 0, sb_mnt_opts_compat, struct su 67 LSM_HOOK(int, 0, sb_mnt_opts_compat, struct super_block *sb, void *mnt_opts) 68 LSM_HOOK(int, 0, sb_remount, struct super_bloc 68 LSM_HOOK(int, 0, sb_remount, struct super_block *sb, void *mnt_opts) 69 LSM_HOOK(int, 0, sb_kern_mount, const struct s 69 LSM_HOOK(int, 0, sb_kern_mount, const struct super_block *sb) 70 LSM_HOOK(int, 0, sb_show_options, struct seq_f 70 LSM_HOOK(int, 0, sb_show_options, struct seq_file *m, struct super_block *sb) 71 LSM_HOOK(int, 0, sb_statfs, struct dentry *den 71 LSM_HOOK(int, 0, sb_statfs, struct dentry *dentry) 72 LSM_HOOK(int, 0, sb_mount, const char *dev_nam 72 LSM_HOOK(int, 0, sb_mount, const char *dev_name, const struct path *path, 73 const char *type, unsigned long flags 73 const char *type, unsigned long flags, void *data) 74 LSM_HOOK(int, 0, sb_umount, struct vfsmount *m 74 LSM_HOOK(int, 0, sb_umount, struct vfsmount *mnt, int flags) 75 LSM_HOOK(int, 0, sb_pivotroot, const struct pa 75 LSM_HOOK(int, 0, sb_pivotroot, const struct path *old_path, 76 const struct path *new_path) 76 const struct path *new_path) 77 LSM_HOOK(int, 0, sb_set_mnt_opts, struct super 77 LSM_HOOK(int, 0, sb_set_mnt_opts, struct super_block *sb, void *mnt_opts, 78 unsigned long kern_flags, unsigned lo 78 unsigned long kern_flags, unsigned long *set_kern_flags) 79 LSM_HOOK(int, 0, sb_clone_mnt_opts, const stru 79 LSM_HOOK(int, 0, sb_clone_mnt_opts, const struct super_block *oldsb, 80 struct super_block *newsb, unsigned l 80 struct super_block *newsb, unsigned long kern_flags, 81 unsigned long *set_kern_flags) 81 unsigned long *set_kern_flags) 82 LSM_HOOK(int, 0, move_mount, const struct path 82 LSM_HOOK(int, 0, move_mount, const struct path *from_path, 83 const struct path *to_path) 83 const struct path *to_path) 84 LSM_HOOK(int, -EOPNOTSUPP, dentry_init_securit 84 LSM_HOOK(int, -EOPNOTSUPP, dentry_init_security, struct dentry *dentry, 85 int mode, const struct qstr *name, co 85 int mode, const struct qstr *name, const char **xattr_name, 86 void **ctx, u32 *ctxlen) 86 void **ctx, u32 *ctxlen) 87 LSM_HOOK(int, 0, dentry_create_files_as, struc 87 LSM_HOOK(int, 0, dentry_create_files_as, struct dentry *dentry, int mode, 88 struct qstr *name, const struct cred 88 struct qstr *name, const struct cred *old, struct cred *new) 89 89 90 #ifdef CONFIG_SECURITY_PATH 90 #ifdef CONFIG_SECURITY_PATH 91 LSM_HOOK(int, 0, path_unlink, const struct pat 91 LSM_HOOK(int, 0, path_unlink, const struct path *dir, struct dentry *dentry) 92 LSM_HOOK(int, 0, path_mkdir, const struct path 92 LSM_HOOK(int, 0, path_mkdir, const struct path *dir, struct dentry *dentry, 93 umode_t mode) 93 umode_t mode) 94 LSM_HOOK(int, 0, path_rmdir, const struct path 94 LSM_HOOK(int, 0, path_rmdir, const struct path *dir, struct dentry *dentry) 95 LSM_HOOK(int, 0, path_mknod, const struct path 95 LSM_HOOK(int, 0, path_mknod, const struct path *dir, struct dentry *dentry, 96 umode_t mode, unsigned int dev) 96 umode_t mode, unsigned int dev) 97 LSM_HOOK(void, LSM_RET_VOID, path_post_mknod, 97 LSM_HOOK(void, LSM_RET_VOID, path_post_mknod, struct mnt_idmap *idmap, 98 struct dentry *dentry) 98 struct dentry *dentry) 99 LSM_HOOK(int, 0, path_truncate, const struct p 99 LSM_HOOK(int, 0, path_truncate, const struct path *path) 100 LSM_HOOK(int, 0, path_symlink, const struct pa 100 LSM_HOOK(int, 0, path_symlink, const struct path *dir, struct dentry *dentry, 101 const char *old_name) 101 const char *old_name) 102 LSM_HOOK(int, 0, path_link, struct dentry *old 102 LSM_HOOK(int, 0, path_link, struct dentry *old_dentry, 103 const struct path *new_dir, struct de 103 const struct path *new_dir, struct dentry *new_dentry) 104 LSM_HOOK(int, 0, path_rename, const struct pat 104 LSM_HOOK(int, 0, path_rename, const struct path *old_dir, 105 struct dentry *old_dentry, const stru 105 struct dentry *old_dentry, const struct path *new_dir, 106 struct dentry *new_dentry, unsigned i 106 struct dentry *new_dentry, unsigned int flags) 107 LSM_HOOK(int, 0, path_chmod, const struct path 107 LSM_HOOK(int, 0, path_chmod, const struct path *path, umode_t mode) 108 LSM_HOOK(int, 0, path_chown, const struct path 108 LSM_HOOK(int, 0, path_chown, const struct path *path, kuid_t uid, kgid_t gid) 109 LSM_HOOK(int, 0, path_chroot, const struct pat 109 LSM_HOOK(int, 0, path_chroot, const struct path *path) 110 #endif /* CONFIG_SECURITY_PATH */ 110 #endif /* CONFIG_SECURITY_PATH */ 111 111 112 /* Needed for inode based security check */ 112 /* Needed for inode based security check */ 113 LSM_HOOK(int, 0, path_notify, const struct pat 113 LSM_HOOK(int, 0, path_notify, const struct path *path, u64 mask, 114 unsigned int obj_type) 114 unsigned int obj_type) 115 LSM_HOOK(int, 0, inode_alloc_security, struct 115 LSM_HOOK(int, 0, inode_alloc_security, struct inode *inode) 116 LSM_HOOK(void, LSM_RET_VOID, inode_free_securi 116 LSM_HOOK(void, LSM_RET_VOID, inode_free_security, struct inode *inode) 117 LSM_HOOK(void, LSM_RET_VOID, inode_free_securi 117 LSM_HOOK(void, LSM_RET_VOID, inode_free_security_rcu, void *inode_security) 118 LSM_HOOK(int, -EOPNOTSUPP, inode_init_security 118 LSM_HOOK(int, -EOPNOTSUPP, inode_init_security, struct inode *inode, 119 struct inode *dir, const struct qstr 119 struct inode *dir, const struct qstr *qstr, struct xattr *xattrs, 120 int *xattr_count) 120 int *xattr_count) 121 LSM_HOOK(int, 0, inode_init_security_anon, str 121 LSM_HOOK(int, 0, inode_init_security_anon, struct inode *inode, 122 const struct qstr *name, const struct 122 const struct qstr *name, const struct inode *context_inode) 123 LSM_HOOK(int, 0, inode_create, struct inode *d 123 LSM_HOOK(int, 0, inode_create, struct inode *dir, struct dentry *dentry, 124 umode_t mode) 124 umode_t mode) 125 LSM_HOOK(void, LSM_RET_VOID, inode_post_create 125 LSM_HOOK(void, LSM_RET_VOID, inode_post_create_tmpfile, struct mnt_idmap *idmap, 126 struct inode *inode) 126 struct inode *inode) 127 LSM_HOOK(int, 0, inode_link, struct dentry *ol 127 LSM_HOOK(int, 0, inode_link, struct dentry *old_dentry, struct inode *dir, 128 struct dentry *new_dentry) 128 struct dentry *new_dentry) 129 LSM_HOOK(int, 0, inode_unlink, struct inode *d 129 LSM_HOOK(int, 0, inode_unlink, struct inode *dir, struct dentry *dentry) 130 LSM_HOOK(int, 0, inode_symlink, struct inode * 130 LSM_HOOK(int, 0, inode_symlink, struct inode *dir, struct dentry *dentry, 131 const char *old_name) 131 const char *old_name) 132 LSM_HOOK(int, 0, inode_mkdir, struct inode *di 132 LSM_HOOK(int, 0, inode_mkdir, struct inode *dir, struct dentry *dentry, 133 umode_t mode) 133 umode_t mode) 134 LSM_HOOK(int, 0, inode_rmdir, struct inode *di 134 LSM_HOOK(int, 0, inode_rmdir, struct inode *dir, struct dentry *dentry) 135 LSM_HOOK(int, 0, inode_mknod, struct inode *di 135 LSM_HOOK(int, 0, inode_mknod, struct inode *dir, struct dentry *dentry, 136 umode_t mode, dev_t dev) 136 umode_t mode, dev_t dev) 137 LSM_HOOK(int, 0, inode_rename, struct inode *o 137 LSM_HOOK(int, 0, inode_rename, struct inode *old_dir, struct dentry *old_dentry, 138 struct inode *new_dir, struct dentry 138 struct inode *new_dir, struct dentry *new_dentry) 139 LSM_HOOK(int, 0, inode_readlink, struct dentry 139 LSM_HOOK(int, 0, inode_readlink, struct dentry *dentry) 140 LSM_HOOK(int, 0, inode_follow_link, struct den 140 LSM_HOOK(int, 0, inode_follow_link, struct dentry *dentry, struct inode *inode, 141 bool rcu) 141 bool rcu) 142 LSM_HOOK(int, 0, inode_permission, struct inod 142 LSM_HOOK(int, 0, inode_permission, struct inode *inode, int mask) 143 LSM_HOOK(int, 0, inode_setattr, struct mnt_idm 143 LSM_HOOK(int, 0, inode_setattr, struct mnt_idmap *idmap, struct dentry *dentry, 144 struct iattr *attr) 144 struct iattr *attr) 145 LSM_HOOK(void, LSM_RET_VOID, inode_post_setatt 145 LSM_HOOK(void, LSM_RET_VOID, inode_post_setattr, struct mnt_idmap *idmap, 146 struct dentry *dentry, int ia_valid) 146 struct dentry *dentry, int ia_valid) 147 LSM_HOOK(int, 0, inode_getattr, const struct p 147 LSM_HOOK(int, 0, inode_getattr, const struct path *path) 148 LSM_HOOK(int, 0, inode_xattr_skipcap, const ch 148 LSM_HOOK(int, 0, inode_xattr_skipcap, const char *name) 149 LSM_HOOK(int, 0, inode_setxattr, struct mnt_id 149 LSM_HOOK(int, 0, inode_setxattr, struct mnt_idmap *idmap, 150 struct dentry *dentry, const char *na 150 struct dentry *dentry, const char *name, const void *value, 151 size_t size, int flags) 151 size_t size, int flags) 152 LSM_HOOK(void, LSM_RET_VOID, inode_post_setxat 152 LSM_HOOK(void, LSM_RET_VOID, inode_post_setxattr, struct dentry *dentry, 153 const char *name, const void *value, 153 const char *name, const void *value, size_t size, int flags) 154 LSM_HOOK(int, 0, inode_getxattr, struct dentry 154 LSM_HOOK(int, 0, inode_getxattr, struct dentry *dentry, const char *name) 155 LSM_HOOK(int, 0, inode_listxattr, struct dentr 155 LSM_HOOK(int, 0, inode_listxattr, struct dentry *dentry) 156 LSM_HOOK(int, 0, inode_removexattr, struct mnt 156 LSM_HOOK(int, 0, inode_removexattr, struct mnt_idmap *idmap, 157 struct dentry *dentry, const char *na 157 struct dentry *dentry, const char *name) 158 LSM_HOOK(void, LSM_RET_VOID, inode_post_remove 158 LSM_HOOK(void, LSM_RET_VOID, inode_post_removexattr, struct dentry *dentry, 159 const char *name) 159 const char *name) 160 LSM_HOOK(int, 0, inode_set_acl, struct mnt_idm 160 LSM_HOOK(int, 0, inode_set_acl, struct mnt_idmap *idmap, 161 struct dentry *dentry, const char *ac 161 struct dentry *dentry, const char *acl_name, struct posix_acl *kacl) 162 LSM_HOOK(void, LSM_RET_VOID, inode_post_set_ac 162 LSM_HOOK(void, LSM_RET_VOID, inode_post_set_acl, struct dentry *dentry, 163 const char *acl_name, struct posix_ac 163 const char *acl_name, struct posix_acl *kacl) 164 LSM_HOOK(int, 0, inode_get_acl, struct mnt_idm 164 LSM_HOOK(int, 0, inode_get_acl, struct mnt_idmap *idmap, 165 struct dentry *dentry, const char *ac 165 struct dentry *dentry, const char *acl_name) 166 LSM_HOOK(int, 0, inode_remove_acl, struct mnt_ 166 LSM_HOOK(int, 0, inode_remove_acl, struct mnt_idmap *idmap, 167 struct dentry *dentry, const char *ac 167 struct dentry *dentry, const char *acl_name) 168 LSM_HOOK(void, LSM_RET_VOID, inode_post_remove 168 LSM_HOOK(void, LSM_RET_VOID, inode_post_remove_acl, struct mnt_idmap *idmap, 169 struct dentry *dentry, const char *ac 169 struct dentry *dentry, const char *acl_name) 170 LSM_HOOK(int, 0, inode_need_killpriv, struct d 170 LSM_HOOK(int, 0, inode_need_killpriv, struct dentry *dentry) 171 LSM_HOOK(int, 0, inode_killpriv, struct mnt_id 171 LSM_HOOK(int, 0, inode_killpriv, struct mnt_idmap *idmap, 172 struct dentry *dentry) 172 struct dentry *dentry) 173 LSM_HOOK(int, -EOPNOTSUPP, inode_getsecurity, 173 LSM_HOOK(int, -EOPNOTSUPP, inode_getsecurity, struct mnt_idmap *idmap, 174 struct inode *inode, const char *name 174 struct inode *inode, const char *name, void **buffer, bool alloc) 175 LSM_HOOK(int, -EOPNOTSUPP, inode_setsecurity, 175 LSM_HOOK(int, -EOPNOTSUPP, inode_setsecurity, struct inode *inode, 176 const char *name, const void *value, 176 const char *name, const void *value, size_t size, int flags) 177 LSM_HOOK(int, 0, inode_listsecurity, struct in 177 LSM_HOOK(int, 0, inode_listsecurity, struct inode *inode, char *buffer, 178 size_t buffer_size) 178 size_t buffer_size) 179 LSM_HOOK(void, LSM_RET_VOID, inode_getsecid, s 179 LSM_HOOK(void, LSM_RET_VOID, inode_getsecid, struct inode *inode, u32 *secid) 180 LSM_HOOK(int, 0, inode_copy_up, struct dentry 180 LSM_HOOK(int, 0, inode_copy_up, struct dentry *src, struct cred **new) 181 LSM_HOOK(int, -EOPNOTSUPP, inode_copy_up_xattr 181 LSM_HOOK(int, -EOPNOTSUPP, inode_copy_up_xattr, struct dentry *src, 182 const char *name) 182 const char *name) 183 LSM_HOOK(int, 0, inode_setintegrity, const str 183 LSM_HOOK(int, 0, inode_setintegrity, const struct inode *inode, 184 enum lsm_integrity_type type, const v 184 enum lsm_integrity_type type, const void *value, size_t size) 185 LSM_HOOK(int, 0, kernfs_init_security, struct 185 LSM_HOOK(int, 0, kernfs_init_security, struct kernfs_node *kn_dir, 186 struct kernfs_node *kn) 186 struct kernfs_node *kn) 187 LSM_HOOK(int, 0, file_permission, struct file 187 LSM_HOOK(int, 0, file_permission, struct file *file, int mask) 188 LSM_HOOK(int, 0, file_alloc_security, struct f 188 LSM_HOOK(int, 0, file_alloc_security, struct file *file) 189 LSM_HOOK(void, LSM_RET_VOID, file_release, str 189 LSM_HOOK(void, LSM_RET_VOID, file_release, struct file *file) 190 LSM_HOOK(void, LSM_RET_VOID, file_free_securit 190 LSM_HOOK(void, LSM_RET_VOID, file_free_security, struct file *file) 191 LSM_HOOK(int, 0, file_ioctl, struct file *file 191 LSM_HOOK(int, 0, file_ioctl, struct file *file, unsigned int cmd, 192 unsigned long arg) 192 unsigned long arg) 193 LSM_HOOK(int, 0, file_ioctl_compat, struct fil 193 LSM_HOOK(int, 0, file_ioctl_compat, struct file *file, unsigned int cmd, 194 unsigned long arg) 194 unsigned long arg) 195 LSM_HOOK(int, 0, mmap_addr, unsigned long addr 195 LSM_HOOK(int, 0, mmap_addr, unsigned long addr) 196 LSM_HOOK(int, 0, mmap_file, struct file *file, 196 LSM_HOOK(int, 0, mmap_file, struct file *file, unsigned long reqprot, 197 unsigned long prot, unsigned long fla 197 unsigned long prot, unsigned long flags) 198 LSM_HOOK(int, 0, file_mprotect, struct vm_area 198 LSM_HOOK(int, 0, file_mprotect, struct vm_area_struct *vma, 199 unsigned long reqprot, unsigned long 199 unsigned long reqprot, unsigned long prot) 200 LSM_HOOK(int, 0, file_lock, struct file *file, 200 LSM_HOOK(int, 0, file_lock, struct file *file, unsigned int cmd) 201 LSM_HOOK(int, 0, file_fcntl, struct file *file 201 LSM_HOOK(int, 0, file_fcntl, struct file *file, unsigned int cmd, 202 unsigned long arg) 202 unsigned long arg) 203 LSM_HOOK(void, LSM_RET_VOID, file_set_fowner, 203 LSM_HOOK(void, LSM_RET_VOID, file_set_fowner, struct file *file) 204 LSM_HOOK(int, 0, file_send_sigiotask, struct t 204 LSM_HOOK(int, 0, file_send_sigiotask, struct task_struct *tsk, 205 struct fown_struct *fown, int sig) 205 struct fown_struct *fown, int sig) 206 LSM_HOOK(int, 0, file_receive, struct file *fi 206 LSM_HOOK(int, 0, file_receive, struct file *file) 207 LSM_HOOK(int, 0, file_open, struct file *file) 207 LSM_HOOK(int, 0, file_open, struct file *file) 208 LSM_HOOK(int, 0, file_post_open, struct file * 208 LSM_HOOK(int, 0, file_post_open, struct file *file, int mask) 209 LSM_HOOK(int, 0, file_truncate, struct file *f 209 LSM_HOOK(int, 0, file_truncate, struct file *file) 210 LSM_HOOK(int, 0, task_alloc, struct task_struc 210 LSM_HOOK(int, 0, task_alloc, struct task_struct *task, 211 unsigned long clone_flags) 211 unsigned long clone_flags) 212 LSM_HOOK(void, LSM_RET_VOID, task_free, struct 212 LSM_HOOK(void, LSM_RET_VOID, task_free, struct task_struct *task) 213 LSM_HOOK(int, 0, cred_alloc_blank, struct cred 213 LSM_HOOK(int, 0, cred_alloc_blank, struct cred *cred, gfp_t gfp) 214 LSM_HOOK(void, LSM_RET_VOID, cred_free, struct 214 LSM_HOOK(void, LSM_RET_VOID, cred_free, struct cred *cred) 215 LSM_HOOK(int, 0, cred_prepare, struct cred *ne 215 LSM_HOOK(int, 0, cred_prepare, struct cred *new, const struct cred *old, 216 gfp_t gfp) 216 gfp_t gfp) 217 LSM_HOOK(void, LSM_RET_VOID, cred_transfer, st 217 LSM_HOOK(void, LSM_RET_VOID, cred_transfer, struct cred *new, 218 const struct cred *old) 218 const struct cred *old) 219 LSM_HOOK(void, LSM_RET_VOID, cred_getsecid, co 219 LSM_HOOK(void, LSM_RET_VOID, cred_getsecid, const struct cred *c, u32 *secid) 220 LSM_HOOK(int, 0, kernel_act_as, struct cred *n 220 LSM_HOOK(int, 0, kernel_act_as, struct cred *new, u32 secid) 221 LSM_HOOK(int, 0, kernel_create_files_as, struc 221 LSM_HOOK(int, 0, kernel_create_files_as, struct cred *new, struct inode *inode) 222 LSM_HOOK(int, 0, kernel_module_request, char * 222 LSM_HOOK(int, 0, kernel_module_request, char *kmod_name) 223 LSM_HOOK(int, 0, kernel_load_data, enum kernel 223 LSM_HOOK(int, 0, kernel_load_data, enum kernel_load_data_id id, bool contents) 224 LSM_HOOK(int, 0, kernel_post_load_data, char * 224 LSM_HOOK(int, 0, kernel_post_load_data, char *buf, loff_t size, 225 enum kernel_load_data_id id, char *de 225 enum kernel_load_data_id id, char *description) 226 LSM_HOOK(int, 0, kernel_read_file, struct file 226 LSM_HOOK(int, 0, kernel_read_file, struct file *file, 227 enum kernel_read_file_id id, bool con 227 enum kernel_read_file_id id, bool contents) 228 LSM_HOOK(int, 0, kernel_post_read_file, struct 228 LSM_HOOK(int, 0, kernel_post_read_file, struct file *file, char *buf, 229 loff_t size, enum kernel_read_file_id 229 loff_t size, enum kernel_read_file_id id) 230 LSM_HOOK(int, 0, task_fix_setuid, struct cred 230 LSM_HOOK(int, 0, task_fix_setuid, struct cred *new, const struct cred *old, 231 int flags) 231 int flags) 232 LSM_HOOK(int, 0, task_fix_setgid, struct cred 232 LSM_HOOK(int, 0, task_fix_setgid, struct cred *new, const struct cred * old, 233 int flags) 233 int flags) 234 LSM_HOOK(int, 0, task_fix_setgroups, struct cr 234 LSM_HOOK(int, 0, task_fix_setgroups, struct cred *new, const struct cred * old) 235 LSM_HOOK(int, 0, task_setpgid, struct task_str 235 LSM_HOOK(int, 0, task_setpgid, struct task_struct *p, pid_t pgid) 236 LSM_HOOK(int, 0, task_getpgid, struct task_str 236 LSM_HOOK(int, 0, task_getpgid, struct task_struct *p) 237 LSM_HOOK(int, 0, task_getsid, struct task_stru 237 LSM_HOOK(int, 0, task_getsid, struct task_struct *p) 238 LSM_HOOK(void, LSM_RET_VOID, current_getsecid_ 238 LSM_HOOK(void, LSM_RET_VOID, current_getsecid_subj, u32 *secid) 239 LSM_HOOK(void, LSM_RET_VOID, task_getsecid_obj 239 LSM_HOOK(void, LSM_RET_VOID, task_getsecid_obj, 240 struct task_struct *p, u32 *secid) 240 struct task_struct *p, u32 *secid) 241 LSM_HOOK(int, 0, task_setnice, struct task_str 241 LSM_HOOK(int, 0, task_setnice, struct task_struct *p, int nice) 242 LSM_HOOK(int, 0, task_setioprio, struct task_s 242 LSM_HOOK(int, 0, task_setioprio, struct task_struct *p, int ioprio) 243 LSM_HOOK(int, 0, task_getioprio, struct task_s 243 LSM_HOOK(int, 0, task_getioprio, struct task_struct *p) 244 LSM_HOOK(int, 0, task_prlimit, const struct cr 244 LSM_HOOK(int, 0, task_prlimit, const struct cred *cred, 245 const struct cred *tcred, unsigned in 245 const struct cred *tcred, unsigned int flags) 246 LSM_HOOK(int, 0, task_setrlimit, struct task_s 246 LSM_HOOK(int, 0, task_setrlimit, struct task_struct *p, unsigned int resource, 247 struct rlimit *new_rlim) 247 struct rlimit *new_rlim) 248 LSM_HOOK(int, 0, task_setscheduler, struct tas 248 LSM_HOOK(int, 0, task_setscheduler, struct task_struct *p) 249 LSM_HOOK(int, 0, task_getscheduler, struct tas 249 LSM_HOOK(int, 0, task_getscheduler, struct task_struct *p) 250 LSM_HOOK(int, 0, task_movememory, struct task_ 250 LSM_HOOK(int, 0, task_movememory, struct task_struct *p) 251 LSM_HOOK(int, 0, task_kill, struct task_struct 251 LSM_HOOK(int, 0, task_kill, struct task_struct *p, struct kernel_siginfo *info, 252 int sig, const struct cred *cred) 252 int sig, const struct cred *cred) 253 LSM_HOOK(int, -ENOSYS, task_prctl, int option, 253 LSM_HOOK(int, -ENOSYS, task_prctl, int option, unsigned long arg2, 254 unsigned long arg3, unsigned long arg 254 unsigned long arg3, unsigned long arg4, unsigned long arg5) 255 LSM_HOOK(void, LSM_RET_VOID, task_to_inode, st 255 LSM_HOOK(void, LSM_RET_VOID, task_to_inode, struct task_struct *p, 256 struct inode *inode) 256 struct inode *inode) 257 LSM_HOOK(int, 0, userns_create, const struct c 257 LSM_HOOK(int, 0, userns_create, const struct cred *cred) 258 LSM_HOOK(int, 0, ipc_permission, struct kern_i 258 LSM_HOOK(int, 0, ipc_permission, struct kern_ipc_perm *ipcp, short flag) 259 LSM_HOOK(void, LSM_RET_VOID, ipc_getsecid, str 259 LSM_HOOK(void, LSM_RET_VOID, ipc_getsecid, struct kern_ipc_perm *ipcp, 260 u32 *secid) 260 u32 *secid) 261 LSM_HOOK(int, 0, msg_msg_alloc_security, struc 261 LSM_HOOK(int, 0, msg_msg_alloc_security, struct msg_msg *msg) 262 LSM_HOOK(void, LSM_RET_VOID, msg_msg_free_secu 262 LSM_HOOK(void, LSM_RET_VOID, msg_msg_free_security, struct msg_msg *msg) 263 LSM_HOOK(int, 0, msg_queue_alloc_security, str 263 LSM_HOOK(int, 0, msg_queue_alloc_security, struct kern_ipc_perm *perm) 264 LSM_HOOK(void, LSM_RET_VOID, msg_queue_free_se 264 LSM_HOOK(void, LSM_RET_VOID, msg_queue_free_security, 265 struct kern_ipc_perm *perm) 265 struct kern_ipc_perm *perm) 266 LSM_HOOK(int, 0, msg_queue_associate, struct k 266 LSM_HOOK(int, 0, msg_queue_associate, struct kern_ipc_perm *perm, int msqflg) 267 LSM_HOOK(int, 0, msg_queue_msgctl, struct kern 267 LSM_HOOK(int, 0, msg_queue_msgctl, struct kern_ipc_perm *perm, int cmd) 268 LSM_HOOK(int, 0, msg_queue_msgsnd, struct kern 268 LSM_HOOK(int, 0, msg_queue_msgsnd, struct kern_ipc_perm *perm, 269 struct msg_msg *msg, int msqflg) 269 struct msg_msg *msg, int msqflg) 270 LSM_HOOK(int, 0, msg_queue_msgrcv, struct kern 270 LSM_HOOK(int, 0, msg_queue_msgrcv, struct kern_ipc_perm *perm, 271 struct msg_msg *msg, struct task_stru 271 struct msg_msg *msg, struct task_struct *target, long type, int mode) 272 LSM_HOOK(int, 0, shm_alloc_security, struct ke 272 LSM_HOOK(int, 0, shm_alloc_security, struct kern_ipc_perm *perm) 273 LSM_HOOK(void, LSM_RET_VOID, shm_free_security 273 LSM_HOOK(void, LSM_RET_VOID, shm_free_security, struct kern_ipc_perm *perm) 274 LSM_HOOK(int, 0, shm_associate, struct kern_ip 274 LSM_HOOK(int, 0, shm_associate, struct kern_ipc_perm *perm, int shmflg) 275 LSM_HOOK(int, 0, shm_shmctl, struct kern_ipc_p 275 LSM_HOOK(int, 0, shm_shmctl, struct kern_ipc_perm *perm, int cmd) 276 LSM_HOOK(int, 0, shm_shmat, struct kern_ipc_pe 276 LSM_HOOK(int, 0, shm_shmat, struct kern_ipc_perm *perm, char __user *shmaddr, 277 int shmflg) 277 int shmflg) 278 LSM_HOOK(int, 0, sem_alloc_security, struct ke 278 LSM_HOOK(int, 0, sem_alloc_security, struct kern_ipc_perm *perm) 279 LSM_HOOK(void, LSM_RET_VOID, sem_free_security 279 LSM_HOOK(void, LSM_RET_VOID, sem_free_security, struct kern_ipc_perm *perm) 280 LSM_HOOK(int, 0, sem_associate, struct kern_ip 280 LSM_HOOK(int, 0, sem_associate, struct kern_ipc_perm *perm, int semflg) 281 LSM_HOOK(int, 0, sem_semctl, struct kern_ipc_p 281 LSM_HOOK(int, 0, sem_semctl, struct kern_ipc_perm *perm, int cmd) 282 LSM_HOOK(int, 0, sem_semop, struct kern_ipc_pe 282 LSM_HOOK(int, 0, sem_semop, struct kern_ipc_perm *perm, struct sembuf *sops, 283 unsigned nsops, int alter) 283 unsigned nsops, int alter) 284 LSM_HOOK(int, 0, netlink_send, struct sock *sk 284 LSM_HOOK(int, 0, netlink_send, struct sock *sk, struct sk_buff *skb) 285 LSM_HOOK(void, LSM_RET_VOID, d_instantiate, st 285 LSM_HOOK(void, LSM_RET_VOID, d_instantiate, struct dentry *dentry, 286 struct inode *inode) 286 struct inode *inode) 287 LSM_HOOK(int, -EOPNOTSUPP, getselfattr, unsign 287 LSM_HOOK(int, -EOPNOTSUPP, getselfattr, unsigned int attr, 288 struct lsm_ctx __user *ctx, u32 *size 288 struct lsm_ctx __user *ctx, u32 *size, u32 flags) 289 LSM_HOOK(int, -EOPNOTSUPP, setselfattr, unsign 289 LSM_HOOK(int, -EOPNOTSUPP, setselfattr, unsigned int attr, 290 struct lsm_ctx *ctx, u32 size, u32 fl 290 struct lsm_ctx *ctx, u32 size, u32 flags) 291 LSM_HOOK(int, -EINVAL, getprocattr, struct tas 291 LSM_HOOK(int, -EINVAL, getprocattr, struct task_struct *p, const char *name, 292 char **value) 292 char **value) 293 LSM_HOOK(int, -EINVAL, setprocattr, const char 293 LSM_HOOK(int, -EINVAL, setprocattr, const char *name, void *value, size_t size) 294 LSM_HOOK(int, 0, ismaclabel, const char *name) 294 LSM_HOOK(int, 0, ismaclabel, const char *name) 295 LSM_HOOK(int, -EOPNOTSUPP, secid_to_secctx, u3 295 LSM_HOOK(int, -EOPNOTSUPP, secid_to_secctx, u32 secid, char **secdata, 296 u32 *seclen) 296 u32 *seclen) 297 LSM_HOOK(int, 0, secctx_to_secid, const char * 297 LSM_HOOK(int, 0, secctx_to_secid, const char *secdata, u32 seclen, u32 *secid) 298 LSM_HOOK(void, LSM_RET_VOID, release_secctx, c 298 LSM_HOOK(void, LSM_RET_VOID, release_secctx, char *secdata, u32 seclen) 299 LSM_HOOK(void, LSM_RET_VOID, inode_invalidate_ 299 LSM_HOOK(void, LSM_RET_VOID, inode_invalidate_secctx, struct inode *inode) 300 LSM_HOOK(int, 0, inode_notifysecctx, struct in 300 LSM_HOOK(int, 0, inode_notifysecctx, struct inode *inode, void *ctx, u32 ctxlen) 301 LSM_HOOK(int, 0, inode_setsecctx, struct dentr 301 LSM_HOOK(int, 0, inode_setsecctx, struct dentry *dentry, void *ctx, u32 ctxlen) 302 LSM_HOOK(int, -EOPNOTSUPP, inode_getsecctx, st 302 LSM_HOOK(int, -EOPNOTSUPP, inode_getsecctx, struct inode *inode, void **ctx, 303 u32 *ctxlen) 303 u32 *ctxlen) 304 304 305 #if defined(CONFIG_SECURITY) && defined(CONFIG 305 #if defined(CONFIG_SECURITY) && defined(CONFIG_WATCH_QUEUE) 306 LSM_HOOK(int, 0, post_notification, const stru 306 LSM_HOOK(int, 0, post_notification, const struct cred *w_cred, 307 const struct cred *cred, struct watch 307 const struct cred *cred, struct watch_notification *n) 308 #endif /* CONFIG_SECURITY && CONFIG_WATCH_QUEU 308 #endif /* CONFIG_SECURITY && CONFIG_WATCH_QUEUE */ 309 309 310 #if defined(CONFIG_SECURITY) && defined(CONFIG 310 #if defined(CONFIG_SECURITY) && defined(CONFIG_KEY_NOTIFICATIONS) 311 LSM_HOOK(int, 0, watch_key, struct key *key) 311 LSM_HOOK(int, 0, watch_key, struct key *key) 312 #endif /* CONFIG_SECURITY && CONFIG_KEY_NOTIFI 312 #endif /* CONFIG_SECURITY && CONFIG_KEY_NOTIFICATIONS */ 313 313 314 #ifdef CONFIG_SECURITY_NETWORK 314 #ifdef CONFIG_SECURITY_NETWORK 315 LSM_HOOK(int, 0, unix_stream_connect, struct s 315 LSM_HOOK(int, 0, unix_stream_connect, struct sock *sock, struct sock *other, 316 struct sock *newsk) 316 struct sock *newsk) 317 LSM_HOOK(int, 0, unix_may_send, struct socket 317 LSM_HOOK(int, 0, unix_may_send, struct socket *sock, struct socket *other) 318 LSM_HOOK(int, 0, socket_create, int family, in 318 LSM_HOOK(int, 0, socket_create, int family, int type, int protocol, int kern) 319 LSM_HOOK(int, 0, socket_post_create, struct so 319 LSM_HOOK(int, 0, socket_post_create, struct socket *sock, int family, int type, 320 int protocol, int kern) 320 int protocol, int kern) 321 LSM_HOOK(int, 0, socket_socketpair, struct soc 321 LSM_HOOK(int, 0, socket_socketpair, struct socket *socka, struct socket *sockb) 322 LSM_HOOK(int, 0, socket_bind, struct socket *s 322 LSM_HOOK(int, 0, socket_bind, struct socket *sock, struct sockaddr *address, 323 int addrlen) 323 int addrlen) 324 LSM_HOOK(int, 0, socket_connect, struct socket 324 LSM_HOOK(int, 0, socket_connect, struct socket *sock, struct sockaddr *address, 325 int addrlen) 325 int addrlen) 326 LSM_HOOK(int, 0, socket_listen, struct socket 326 LSM_HOOK(int, 0, socket_listen, struct socket *sock, int backlog) 327 LSM_HOOK(int, 0, socket_accept, struct socket 327 LSM_HOOK(int, 0, socket_accept, struct socket *sock, struct socket *newsock) 328 LSM_HOOK(int, 0, socket_sendmsg, struct socket 328 LSM_HOOK(int, 0, socket_sendmsg, struct socket *sock, struct msghdr *msg, 329 int size) 329 int size) 330 LSM_HOOK(int, 0, socket_recvmsg, struct socket 330 LSM_HOOK(int, 0, socket_recvmsg, struct socket *sock, struct msghdr *msg, 331 int size, int flags) 331 int size, int flags) 332 LSM_HOOK(int, 0, socket_getsockname, struct so 332 LSM_HOOK(int, 0, socket_getsockname, struct socket *sock) 333 LSM_HOOK(int, 0, socket_getpeername, struct so 333 LSM_HOOK(int, 0, socket_getpeername, struct socket *sock) 334 LSM_HOOK(int, 0, socket_getsockopt, struct soc 334 LSM_HOOK(int, 0, socket_getsockopt, struct socket *sock, int level, int optname) 335 LSM_HOOK(int, 0, socket_setsockopt, struct soc 335 LSM_HOOK(int, 0, socket_setsockopt, struct socket *sock, int level, int optname) 336 LSM_HOOK(int, 0, socket_shutdown, struct socke 336 LSM_HOOK(int, 0, socket_shutdown, struct socket *sock, int how) 337 LSM_HOOK(int, 0, socket_sock_rcv_skb, struct s 337 LSM_HOOK(int, 0, socket_sock_rcv_skb, struct sock *sk, struct sk_buff *skb) 338 LSM_HOOK(int, -ENOPROTOOPT, socket_getpeersec_ 338 LSM_HOOK(int, -ENOPROTOOPT, socket_getpeersec_stream, struct socket *sock, 339 sockptr_t optval, sockptr_t optlen, u 339 sockptr_t optval, sockptr_t optlen, unsigned int len) 340 LSM_HOOK(int, -ENOPROTOOPT, socket_getpeersec_ 340 LSM_HOOK(int, -ENOPROTOOPT, socket_getpeersec_dgram, struct socket *sock, 341 struct sk_buff *skb, u32 *secid) 341 struct sk_buff *skb, u32 *secid) 342 LSM_HOOK(int, 0, sk_alloc_security, struct soc 342 LSM_HOOK(int, 0, sk_alloc_security, struct sock *sk, int family, gfp_t priority) 343 LSM_HOOK(void, LSM_RET_VOID, sk_free_security, 343 LSM_HOOK(void, LSM_RET_VOID, sk_free_security, struct sock *sk) 344 LSM_HOOK(void, LSM_RET_VOID, sk_clone_security 344 LSM_HOOK(void, LSM_RET_VOID, sk_clone_security, const struct sock *sk, 345 struct sock *newsk) 345 struct sock *newsk) 346 LSM_HOOK(void, LSM_RET_VOID, sk_getsecid, cons 346 LSM_HOOK(void, LSM_RET_VOID, sk_getsecid, const struct sock *sk, u32 *secid) 347 LSM_HOOK(void, LSM_RET_VOID, sock_graft, struc 347 LSM_HOOK(void, LSM_RET_VOID, sock_graft, struct sock *sk, struct socket *parent) 348 LSM_HOOK(int, 0, inet_conn_request, const stru 348 LSM_HOOK(int, 0, inet_conn_request, const struct sock *sk, struct sk_buff *skb, 349 struct request_sock *req) 349 struct request_sock *req) 350 LSM_HOOK(void, LSM_RET_VOID, inet_csk_clone, s 350 LSM_HOOK(void, LSM_RET_VOID, inet_csk_clone, struct sock *newsk, 351 const struct request_sock *req) 351 const struct request_sock *req) 352 LSM_HOOK(void, LSM_RET_VOID, inet_conn_establi 352 LSM_HOOK(void, LSM_RET_VOID, inet_conn_established, struct sock *sk, 353 struct sk_buff *skb) 353 struct sk_buff *skb) 354 LSM_HOOK(int, 0, secmark_relabel_packet, u32 s 354 LSM_HOOK(int, 0, secmark_relabel_packet, u32 secid) 355 LSM_HOOK(void, LSM_RET_VOID, secmark_refcount_ 355 LSM_HOOK(void, LSM_RET_VOID, secmark_refcount_inc, void) 356 LSM_HOOK(void, LSM_RET_VOID, secmark_refcount_ 356 LSM_HOOK(void, LSM_RET_VOID, secmark_refcount_dec, void) 357 LSM_HOOK(void, LSM_RET_VOID, req_classify_flow 357 LSM_HOOK(void, LSM_RET_VOID, req_classify_flow, const struct request_sock *req, 358 struct flowi_common *flic) 358 struct flowi_common *flic) 359 LSM_HOOK(int, 0, tun_dev_alloc_security, void 359 LSM_HOOK(int, 0, tun_dev_alloc_security, void *security) 360 LSM_HOOK(int, 0, tun_dev_create, void) 360 LSM_HOOK(int, 0, tun_dev_create, void) 361 LSM_HOOK(int, 0, tun_dev_attach_queue, void *s 361 LSM_HOOK(int, 0, tun_dev_attach_queue, void *security) 362 LSM_HOOK(int, 0, tun_dev_attach, struct sock * 362 LSM_HOOK(int, 0, tun_dev_attach, struct sock *sk, void *security) 363 LSM_HOOK(int, 0, tun_dev_open, void *security) 363 LSM_HOOK(int, 0, tun_dev_open, void *security) 364 LSM_HOOK(int, 0, sctp_assoc_request, struct sc 364 LSM_HOOK(int, 0, sctp_assoc_request, struct sctp_association *asoc, 365 struct sk_buff *skb) 365 struct sk_buff *skb) 366 LSM_HOOK(int, 0, sctp_bind_connect, struct soc 366 LSM_HOOK(int, 0, sctp_bind_connect, struct sock *sk, int optname, 367 struct sockaddr *address, int addrlen 367 struct sockaddr *address, int addrlen) 368 LSM_HOOK(void, LSM_RET_VOID, sctp_sk_clone, st 368 LSM_HOOK(void, LSM_RET_VOID, sctp_sk_clone, struct sctp_association *asoc, 369 struct sock *sk, struct sock *newsk) 369 struct sock *sk, struct sock *newsk) 370 LSM_HOOK(int, 0, sctp_assoc_established, struc 370 LSM_HOOK(int, 0, sctp_assoc_established, struct sctp_association *asoc, 371 struct sk_buff *skb) 371 struct sk_buff *skb) 372 LSM_HOOK(int, 0, mptcp_add_subflow, struct soc 372 LSM_HOOK(int, 0, mptcp_add_subflow, struct sock *sk, struct sock *ssk) 373 #endif /* CONFIG_SECURITY_NETWORK */ 373 #endif /* CONFIG_SECURITY_NETWORK */ 374 374 375 #ifdef CONFIG_SECURITY_INFINIBAND 375 #ifdef CONFIG_SECURITY_INFINIBAND 376 LSM_HOOK(int, 0, ib_pkey_access, void *sec, u6 376 LSM_HOOK(int, 0, ib_pkey_access, void *sec, u64 subnet_prefix, u16 pkey) 377 LSM_HOOK(int, 0, ib_endport_manage_subnet, voi 377 LSM_HOOK(int, 0, ib_endport_manage_subnet, void *sec, const char *dev_name, 378 u8 port_num) 378 u8 port_num) 379 LSM_HOOK(int, 0, ib_alloc_security, void *sec) 379 LSM_HOOK(int, 0, ib_alloc_security, void *sec) 380 #endif /* CONFIG_SECURITY_INFINIBAND */ 380 #endif /* CONFIG_SECURITY_INFINIBAND */ 381 381 382 #ifdef CONFIG_SECURITY_NETWORK_XFRM 382 #ifdef CONFIG_SECURITY_NETWORK_XFRM 383 LSM_HOOK(int, 0, xfrm_policy_alloc_security, s 383 LSM_HOOK(int, 0, xfrm_policy_alloc_security, struct xfrm_sec_ctx **ctxp, 384 struct xfrm_user_sec_ctx *sec_ctx, gf 384 struct xfrm_user_sec_ctx *sec_ctx, gfp_t gfp) 385 LSM_HOOK(int, 0, xfrm_policy_clone_security, s 385 LSM_HOOK(int, 0, xfrm_policy_clone_security, struct xfrm_sec_ctx *old_ctx, 386 struct xfrm_sec_ctx **new_ctx) 386 struct xfrm_sec_ctx **new_ctx) 387 LSM_HOOK(void, LSM_RET_VOID, xfrm_policy_free_ 387 LSM_HOOK(void, LSM_RET_VOID, xfrm_policy_free_security, 388 struct xfrm_sec_ctx *ctx) 388 struct xfrm_sec_ctx *ctx) 389 LSM_HOOK(int, 0, xfrm_policy_delete_security, 389 LSM_HOOK(int, 0, xfrm_policy_delete_security, struct xfrm_sec_ctx *ctx) 390 LSM_HOOK(int, 0, xfrm_state_alloc, struct xfrm 390 LSM_HOOK(int, 0, xfrm_state_alloc, struct xfrm_state *x, 391 struct xfrm_user_sec_ctx *sec_ctx) 391 struct xfrm_user_sec_ctx *sec_ctx) 392 LSM_HOOK(int, 0, xfrm_state_alloc_acquire, str 392 LSM_HOOK(int, 0, xfrm_state_alloc_acquire, struct xfrm_state *x, 393 struct xfrm_sec_ctx *polsec, u32 seci 393 struct xfrm_sec_ctx *polsec, u32 secid) 394 LSM_HOOK(void, LSM_RET_VOID, xfrm_state_free_s 394 LSM_HOOK(void, LSM_RET_VOID, xfrm_state_free_security, struct xfrm_state *x) 395 LSM_HOOK(int, 0, xfrm_state_delete_security, s 395 LSM_HOOK(int, 0, xfrm_state_delete_security, struct xfrm_state *x) 396 LSM_HOOK(int, 0, xfrm_policy_lookup, struct xf 396 LSM_HOOK(int, 0, xfrm_policy_lookup, struct xfrm_sec_ctx *ctx, u32 fl_secid) 397 LSM_HOOK(int, 1, xfrm_state_pol_flow_match, st 397 LSM_HOOK(int, 1, xfrm_state_pol_flow_match, struct xfrm_state *x, 398 struct xfrm_policy *xp, const struct 398 struct xfrm_policy *xp, const struct flowi_common *flic) 399 LSM_HOOK(int, 0, xfrm_decode_session, struct s 399 LSM_HOOK(int, 0, xfrm_decode_session, struct sk_buff *skb, u32 *secid, 400 int ckall) 400 int ckall) 401 #endif /* CONFIG_SECURITY_NETWORK_XFRM */ 401 #endif /* CONFIG_SECURITY_NETWORK_XFRM */ 402 402 403 /* key management security hooks */ 403 /* key management security hooks */ 404 #ifdef CONFIG_KEYS 404 #ifdef CONFIG_KEYS 405 LSM_HOOK(int, 0, key_alloc, struct key *key, c 405 LSM_HOOK(int, 0, key_alloc, struct key *key, const struct cred *cred, 406 unsigned long flags) 406 unsigned long flags) 407 LSM_HOOK(int, 0, key_permission, key_ref_t key 407 LSM_HOOK(int, 0, key_permission, key_ref_t key_ref, const struct cred *cred, 408 enum key_need_perm need_perm) 408 enum key_need_perm need_perm) 409 LSM_HOOK(int, 0, key_getsecurity, struct key * 409 LSM_HOOK(int, 0, key_getsecurity, struct key *key, char **buffer) 410 LSM_HOOK(void, LSM_RET_VOID, key_post_create_o 410 LSM_HOOK(void, LSM_RET_VOID, key_post_create_or_update, struct key *keyring, 411 struct key *key, const void *payload, 411 struct key *key, const void *payload, size_t payload_len, 412 unsigned long flags, bool create) 412 unsigned long flags, bool create) 413 #endif /* CONFIG_KEYS */ 413 #endif /* CONFIG_KEYS */ 414 414 415 #ifdef CONFIG_AUDIT 415 #ifdef CONFIG_AUDIT 416 LSM_HOOK(int, 0, audit_rule_init, u32 field, u 416 LSM_HOOK(int, 0, audit_rule_init, u32 field, u32 op, char *rulestr, 417 void **lsmrule, gfp_t gfp) 417 void **lsmrule, gfp_t gfp) 418 LSM_HOOK(int, 0, audit_rule_known, struct audi 418 LSM_HOOK(int, 0, audit_rule_known, struct audit_krule *krule) 419 LSM_HOOK(int, 0, audit_rule_match, u32 secid, 419 LSM_HOOK(int, 0, audit_rule_match, u32 secid, u32 field, u32 op, void *lsmrule) 420 LSM_HOOK(void, LSM_RET_VOID, audit_rule_free, 420 LSM_HOOK(void, LSM_RET_VOID, audit_rule_free, void *lsmrule) 421 #endif /* CONFIG_AUDIT */ 421 #endif /* CONFIG_AUDIT */ 422 422 423 #ifdef CONFIG_BPF_SYSCALL 423 #ifdef CONFIG_BPF_SYSCALL 424 LSM_HOOK(int, 0, bpf, int cmd, union bpf_attr 424 LSM_HOOK(int, 0, bpf, int cmd, union bpf_attr *attr, unsigned int size) 425 LSM_HOOK(int, 0, bpf_map, struct bpf_map *map, 425 LSM_HOOK(int, 0, bpf_map, struct bpf_map *map, fmode_t fmode) 426 LSM_HOOK(int, 0, bpf_prog, struct bpf_prog *pr 426 LSM_HOOK(int, 0, bpf_prog, struct bpf_prog *prog) 427 LSM_HOOK(int, 0, bpf_map_create, struct bpf_ma 427 LSM_HOOK(int, 0, bpf_map_create, struct bpf_map *map, union bpf_attr *attr, 428 struct bpf_token *token) 428 struct bpf_token *token) 429 LSM_HOOK(void, LSM_RET_VOID, bpf_map_free, str 429 LSM_HOOK(void, LSM_RET_VOID, bpf_map_free, struct bpf_map *map) 430 LSM_HOOK(int, 0, bpf_prog_load, struct bpf_pro 430 LSM_HOOK(int, 0, bpf_prog_load, struct bpf_prog *prog, union bpf_attr *attr, 431 struct bpf_token *token) 431 struct bpf_token *token) 432 LSM_HOOK(void, LSM_RET_VOID, bpf_prog_free, st 432 LSM_HOOK(void, LSM_RET_VOID, bpf_prog_free, struct bpf_prog *prog) 433 LSM_HOOK(int, 0, bpf_token_create, struct bpf_ 433 LSM_HOOK(int, 0, bpf_token_create, struct bpf_token *token, union bpf_attr *attr, 434 const struct path *path) 434 const struct path *path) 435 LSM_HOOK(void, LSM_RET_VOID, bpf_token_free, s 435 LSM_HOOK(void, LSM_RET_VOID, bpf_token_free, struct bpf_token *token) 436 LSM_HOOK(int, 0, bpf_token_cmd, const struct b 436 LSM_HOOK(int, 0, bpf_token_cmd, const struct bpf_token *token, enum bpf_cmd cmd) 437 LSM_HOOK(int, 0, bpf_token_capable, const stru 437 LSM_HOOK(int, 0, bpf_token_capable, const struct bpf_token *token, int cap) 438 #endif /* CONFIG_BPF_SYSCALL */ 438 #endif /* CONFIG_BPF_SYSCALL */ 439 439 440 LSM_HOOK(int, 0, locked_down, enum lockdown_re 440 LSM_HOOK(int, 0, locked_down, enum lockdown_reason what) 441 441 442 #ifdef CONFIG_PERF_EVENTS 442 #ifdef CONFIG_PERF_EVENTS 443 LSM_HOOK(int, 0, perf_event_open, struct perf_ 443 LSM_HOOK(int, 0, perf_event_open, struct perf_event_attr *attr, int type) 444 LSM_HOOK(int, 0, perf_event_alloc, struct perf 444 LSM_HOOK(int, 0, perf_event_alloc, struct perf_event *event) 445 LSM_HOOK(int, 0, perf_event_read, struct perf_ 445 LSM_HOOK(int, 0, perf_event_read, struct perf_event *event) 446 LSM_HOOK(int, 0, perf_event_write, struct perf 446 LSM_HOOK(int, 0, perf_event_write, struct perf_event *event) 447 #endif /* CONFIG_PERF_EVENTS */ 447 #endif /* CONFIG_PERF_EVENTS */ 448 448 449 #ifdef CONFIG_IO_URING 449 #ifdef CONFIG_IO_URING 450 LSM_HOOK(int, 0, uring_override_creds, const s 450 LSM_HOOK(int, 0, uring_override_creds, const struct cred *new) 451 LSM_HOOK(int, 0, uring_sqpoll, void) 451 LSM_HOOK(int, 0, uring_sqpoll, void) 452 LSM_HOOK(int, 0, uring_cmd, struct io_uring_cm 452 LSM_HOOK(int, 0, uring_cmd, struct io_uring_cmd *ioucmd) 453 #endif /* CONFIG_IO_URING */ 453 #endif /* CONFIG_IO_URING */ 454 454 455 LSM_HOOK(void, LSM_RET_VOID, initramfs_populat 455 LSM_HOOK(void, LSM_RET_VOID, initramfs_populated, void) 456 456 457 LSM_HOOK(int, 0, bdev_alloc_security, struct b 457 LSM_HOOK(int, 0, bdev_alloc_security, struct block_device *bdev) 458 LSM_HOOK(void, LSM_RET_VOID, bdev_free_securit 458 LSM_HOOK(void, LSM_RET_VOID, bdev_free_security, struct block_device *bdev) 459 LSM_HOOK(int, 0, bdev_setintegrity, struct blo 459 LSM_HOOK(int, 0, bdev_setintegrity, struct block_device *bdev, 460 enum lsm_integrity_type type, const v 460 enum lsm_integrity_type type, const void *value, size_t size) 461 461
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.