Lines Matching +full:sig +full:- +full:dir +full:- +full:cmd

1 // SPDX-License-Identifier: GPL-2.0-or-later
6 * Copyright (C) 2001-2002 Greg Kroah-Hartman <greg@kroah.com>
9 * Copyright (C) 2023 Microsoft Corporation <paul@paul-moore.com>
25 #include <linux/backing-dev.h>
101 /* Boot-time LSM user choice */
169 if (!lsm->enabled) in is_enabled()
172 return *lsm->enabled; in is_enabled()
182 * a hard-coded location for storing the default enabled state. in set_enabled()
184 if (!lsm->enabled) { in set_enabled()
186 lsm->enabled = &lsm_enabled_true; in set_enabled()
188 lsm->enabled = &lsm_enabled_false; in set_enabled()
189 } else if (lsm->enabled == &lsm_enabled_true) { in set_enabled()
191 lsm->enabled = &lsm_enabled_false; in set_enabled()
192 } else if (lsm->enabled == &lsm_enabled_false) { in set_enabled()
194 lsm->enabled = &lsm_enabled_true; in set_enabled()
196 *lsm->enabled = enabled; in set_enabled()
224 if (!lsm->enabled) in append_ordered_lsm()
225 lsm->enabled = &lsm_enabled_true; in append_ordered_lsm()
228 init_debug("%s ordered: %s (%s)\n", from, lsm->name, in append_ordered_lsm()
240 if ((lsm->flags & LSM_FLAG_EXCLUSIVE) && exclusive) { in lsm_allowed()
241 init_debug("exclusive disabled: %s\n", lsm->name); in lsm_allowed()
265 lsm_set_blob_size(&needed->lbs_cred, &blob_sizes.lbs_cred); in lsm_set_blob_sizes()
266 lsm_set_blob_size(&needed->lbs_file, &blob_sizes.lbs_file); in lsm_set_blob_sizes()
267 lsm_set_blob_size(&needed->lbs_ib, &blob_sizes.lbs_ib); in lsm_set_blob_sizes()
272 if (needed->lbs_inode && blob_sizes.lbs_inode == 0) in lsm_set_blob_sizes()
274 lsm_set_blob_size(&needed->lbs_inode, &blob_sizes.lbs_inode); in lsm_set_blob_sizes()
275 lsm_set_blob_size(&needed->lbs_ipc, &blob_sizes.lbs_ipc); in lsm_set_blob_sizes()
276 lsm_set_blob_size(&needed->lbs_key, &blob_sizes.lbs_key); in lsm_set_blob_sizes()
277 lsm_set_blob_size(&needed->lbs_msg_msg, &blob_sizes.lbs_msg_msg); in lsm_set_blob_sizes()
278 lsm_set_blob_size(&needed->lbs_perf_event, &blob_sizes.lbs_perf_event); in lsm_set_blob_sizes()
279 lsm_set_blob_size(&needed->lbs_sock, &blob_sizes.lbs_sock); in lsm_set_blob_sizes()
280 lsm_set_blob_size(&needed->lbs_superblock, &blob_sizes.lbs_superblock); in lsm_set_blob_sizes()
281 lsm_set_blob_size(&needed->lbs_task, &blob_sizes.lbs_task); in lsm_set_blob_sizes()
282 lsm_set_blob_size(&needed->lbs_tun_dev, &blob_sizes.lbs_tun_dev); in lsm_set_blob_sizes()
283 lsm_set_blob_size(&needed->lbs_xattr_count, in lsm_set_blob_sizes()
285 lsm_set_blob_size(&needed->lbs_bdev, &blob_sizes.lbs_bdev); in lsm_set_blob_sizes()
286 lsm_set_blob_size(&needed->lbs_bpf_map, &blob_sizes.lbs_bpf_map); in lsm_set_blob_sizes()
287 lsm_set_blob_size(&needed->lbs_bpf_prog, &blob_sizes.lbs_bpf_prog); in lsm_set_blob_sizes()
288 lsm_set_blob_size(&needed->lbs_bpf_token, &blob_sizes.lbs_bpf_token); in lsm_set_blob_sizes()
299 /* If enabled, do pre-initialization work. */ in prepare_lsm()
301 if ((lsm->flags & LSM_FLAG_EXCLUSIVE) && !exclusive) { in prepare_lsm()
303 init_debug("exclusive chosen: %s\n", lsm->name); in prepare_lsm()
306 lsm_set_blob_sizes(lsm->blobs); in prepare_lsm()
316 init_debug("initializing %s\n", lsm->name); in initialize_lsm()
317 ret = lsm->init(); in initialize_lsm()
318 WARN(ret, "%s failed to initialize: %d\n", lsm->name, ret); in initialize_lsm()
328 /* Populate ordered LSMs list from comma-separated LSM name list. */
336 if (lsm->order == LSM_ORDER_FIRST) in ordered_lsm_parse()
348 * all non-matching Legacy Major LSMs. in ordered_lsm_parse()
352 if ((major->flags & LSM_FLAG_LEGACY_MAJOR) && in ordered_lsm_parse()
353 strcmp(major->name, chosen_major_lsm) != 0) { in ordered_lsm_parse()
356 chosen_major_lsm, major->name); in ordered_lsm_parse()
368 if (strcmp(lsm->name, name) == 0) { in ordered_lsm_parse()
369 if (lsm->order == LSM_ORDER_MUTABLE) in ordered_lsm_parse()
385 if (strcmp(lsm->name, chosen_major_lsm) == 0) in ordered_lsm_parse()
392 if (lsm->order == LSM_ORDER_LAST) in ordered_lsm_parse()
402 origin, lsm->name); in ordered_lsm_parse()
410 struct lsm_static_call *scall = hl->scalls; in lsm_static_call_init()
415 if (!scall->hl) { in lsm_static_call_init()
416 __static_call_update(scall->key, scall->trampoline, in lsm_static_call_init()
417 hl->hook.lsm_func_addr); in lsm_static_call_init()
418 scall->hl = hl; in lsm_static_call_init()
419 static_branch_enable(scall->active); in lsm_static_call_init()
424 panic("%s - Ran out of static slots.\n", __func__); in lsm_static_call_init()
443 pr_cont("%s%s", first++ == 0 ? "" : ",", early->name); in report_lsm_order()
446 pr_cont("%s%s", first++ == 0 ? "" : ",", (*lsm)->name); in report_lsm_order()
502 lsm_early_cred((struct cred *) current->cred); in ordered_lsm_init()
513 if (!lsm->enabled) in early_security_init()
514 lsm->enabled = &lsm_enabled_true; in early_security_init()
523 * security_init - initializes the security framework
540 init_debug(" early started: %s (%s)\n", lsm->name, in security_init()
542 if (lsm->enabled) in security_init()
543 lsm_append(lsm->name, &lsm_names); in security_init()
598 return -ENOMEM; in lsm_append()
605 return -ENOMEM; in lsm_append()
613 * security_add_hooks - Add a modules hooks to the hook lists.
631 if (lsm_active_cnt == 0 || lsm_idlist[lsm_active_cnt - 1] != lsmid) { in security_add_hooks()
647 if (lsm_append(lsmid->name, &lsm_names) < 0) in security_add_hooks()
648 panic("%s - Cannot get early memory.\n", __func__); in security_add_hooks()
674 * lsm_blob_alloc - allocate a composite blob
681 * Returns 0, or -ENOMEM if memory can't be allocated.
692 return -ENOMEM; in lsm_blob_alloc()
697 * lsm_cred_alloc - allocate a composite cred blob
703 * Returns 0, or -ENOMEM if memory can't be allocated.
707 return lsm_blob_alloc(&cred->security, blob_sizes.lbs_cred, gfp); in lsm_cred_alloc()
711 * lsm_early_cred - during initialization allocate a composite cred blob
725 * lsm_file_alloc - allocate a composite file blob
730 * Returns 0, or -ENOMEM if memory can't be allocated.
735 file->f_security = NULL; in lsm_file_alloc()
739 file->f_security = kmem_cache_zalloc(lsm_file_cache, GFP_KERNEL); in lsm_file_alloc()
740 if (file->f_security == NULL) in lsm_file_alloc()
741 return -ENOMEM; in lsm_file_alloc()
746 * lsm_inode_alloc - allocate a composite inode blob
752 * Returns 0, or -ENOMEM if memory can't be allocated.
757 inode->i_security = NULL; in lsm_inode_alloc()
761 inode->i_security = kmem_cache_zalloc(lsm_inode_cache, gfp); in lsm_inode_alloc()
762 if (inode->i_security == NULL) in lsm_inode_alloc()
763 return -ENOMEM; in lsm_inode_alloc()
768 * lsm_task_alloc - allocate a composite task blob
773 * Returns 0, or -ENOMEM if memory can't be allocated.
777 return lsm_blob_alloc(&task->security, blob_sizes.lbs_task, GFP_KERNEL); in lsm_task_alloc()
781 * lsm_ipc_alloc - allocate a composite ipc blob
786 * Returns 0, or -ENOMEM if memory can't be allocated.
790 return lsm_blob_alloc(&kip->security, blob_sizes.lbs_ipc, GFP_KERNEL); in lsm_ipc_alloc()
795 * lsm_key_alloc - allocate a composite key blob
800 * Returns 0, or -ENOMEM if memory can't be allocated.
804 return lsm_blob_alloc(&key->security, blob_sizes.lbs_key, GFP_KERNEL); in lsm_key_alloc()
809 * lsm_msg_msg_alloc - allocate a composite msg_msg blob
814 * Returns 0, or -ENOMEM if memory can't be allocated.
818 return lsm_blob_alloc(&mp->security, blob_sizes.lbs_msg_msg, in lsm_msg_msg_alloc()
823 * lsm_bdev_alloc - allocate a composite block_device blob
828 * Returns 0, or -ENOMEM if memory can't be allocated.
832 return lsm_blob_alloc(&bdev->bd_security, blob_sizes.lbs_bdev, in lsm_bdev_alloc()
838 * lsm_bpf_map_alloc - allocate a composite bpf_map blob
843 * Returns 0, or -ENOMEM if memory can't be allocated.
847 return lsm_blob_alloc(&map->security, blob_sizes.lbs_bpf_map, GFP_KERNEL); in lsm_bpf_map_alloc()
851 * lsm_bpf_prog_alloc - allocate a composite bpf_prog blob
856 * Returns 0, or -ENOMEM if memory can't be allocated.
860 return lsm_blob_alloc(&prog->aux->security, blob_sizes.lbs_bpf_prog, GFP_KERNEL); in lsm_bpf_prog_alloc()
864 * lsm_bpf_token_alloc - allocate a composite bpf_token blob
869 * Returns 0, or -ENOMEM if memory can't be allocated.
873 return lsm_blob_alloc(&token->security, blob_sizes.lbs_bpf_token, GFP_KERNEL); in lsm_bpf_token_alloc()
878 * lsm_early_task - during initialization allocate a composite task blob
892 * lsm_superblock_alloc - allocate a composite superblock blob
897 * Returns 0, or -ENOMEM if memory can't be allocated.
901 return lsm_blob_alloc(&sb->s_security, blob_sizes.lbs_superblock, in lsm_superblock_alloc()
906 * lsm_fill_user_ctx - Fill a user space lsm_ctx structure
918 * Returns 0 on success, -E2BIG if userspace buffer is not large enough,
919 * -EFAULT on a copyout error, -ENOMEM if memory can't be allocated.
931 rc = -E2BIG; in lsm_fill_user_ctx()
935 /* no buffer - return success/0 and set @uctx_len to the req size */ in lsm_fill_user_ctx()
941 rc = -ENOMEM; in lsm_fill_user_ctx()
944 nctx->id = id; in lsm_fill_user_ctx()
945 nctx->flags = flags; in lsm_fill_user_ctx()
946 nctx->len = nctx_len; in lsm_fill_user_ctx()
947 nctx->ctx_len = val_len; in lsm_fill_user_ctx()
948 memcpy(nctx->ctx, val, val_len); in lsm_fill_user_ctx()
951 rc = -EFAULT; in lsm_fill_user_ctx()
1021 scall - static_calls_table.NAME < MAX_LSM_COUNT; scall++) \
1022 if (static_key_enabled(&scall->active->key))
1027 * security_binder_set_context_mgr() - Check if becoming binder ctx mgr is ok
1040 * security_binder_transaction() - Check if a binder transaction is allowed
1055 * security_binder_transfer_binder() - Check if a binder transfer is allowed
1070 * security_binder_transfer_file() - Check if a binder file xfer is allowed
1086 * security_ptrace_access_check() - Check if tracing is allowed
1105 * security_ptrace_traceme() - Check if tracing is allowed
1120 * security_capget() - Get the capability sets for a process
1142 * security_capset() - Set the capability sets for a process
1164 * security_capable() - Check if a process has the necessary capability
1185 * security_quotactl() - Check if a quotactl() syscall is allowed for this fs
1201 * security_quota_on() - Check if QUOTAON is allowed for a dentry
1214 * security_syslog() - Check if accessing the kernel message ring is allowed
1229 * security_settime64() - Check if changing the system time is allowed
1244 * security_vm_enough_memory_mm() - Check if allocating a new mem map is allowed
1269 rc = scall->hl->hook.vm_enough_memory(mm, pages); in security_vm_enough_memory_mm()
1279 * security_bprm_creds_for_exec() - Prepare the credentials for exec()
1282 * If the setup in prepare_exec_creds did not setup @bprm->cred->security
1283 * properly for executing @bprm->file, update the LSM's portion of
1284 * @bprm->cred->security to be what commit_creds needs to install for the new
1286 * transitions between security domains). The hook must set @bprm->secureexec
1290 * If execveat(2) is called with the AT_EXECVE_CHECK flag, bprm->is_check is
1294 * This hook must not change current->cred, only @bprm->cred.
1304 * security_bprm_creds_from_file() - Update linux_binprm creds based on file
1309 * exec, update @bprm->cred to reflect that change. This is called after
1314 * transitions between security domains). The hook must set @bprm->secureexec
1316 * hook must add to @bprm->per_clear any personality flags that should be
1317 * cleared from current->personality. @bprm contains the linux_binprm
1328 * security_bprm_check() - Mediate binary handler search
1332 * It allows a check against the @bprm->cred->security value which was set in
1345 * security_bprm_committing_creds() - Install creds for a process during exec()
1350 * by @current->cred and the information set in @bprm->cred by the
1362 * security_bprm_committed_creds() - Tidy up after cred install during exec()
1367 * point, been set to @current->cred. @bprm points to the linux_binprm
1369 * process such as clearing out non-inheritable signal state. This is called
1378 * security_fs_context_submount() - Initialise fc->security
1382 * Fill out the ->security field for a new fs_context.
1392 * security_fs_context_dup() - Duplicate a fs_context LSM blob
1396 * Allocate and attach a security structure to sc->security. This pointer is
1408 * security_fs_context_parse_param() - Configure a filesystem context
1416 * returned to the caller -ENOPARAM is returned, otherwise a negative
1424 int rc = -ENOPARAM; in security_fs_context_parse_param()
1427 trc = scall->hl->hook.fs_context_parse_param(fc, param); in security_fs_context_parse_param()
1430 else if (trc != -ENOPARAM) in security_fs_context_parse_param()
1437 * security_sb_alloc() - Allocate a super_block LSM blob
1440 * Allocate and attach a security structure to the sb->s_security field. The
1459 * security_sb_delete() - Release super_block LSM associated objects
1471 * security_sb_free() - Free a super_block LSM blob
1474 * Deallocate and clear the sb->s_security field. @sb contains the super_block
1480 kfree(sb->s_security); in security_sb_free()
1481 sb->s_security = NULL; in security_sb_free()
1485 * security_free_mnt_opts() - Free memory associated with mount options
1500 * security_sb_eat_lsm_opts() - Consume LSM mount options
1515 * security_sb_mnt_opts_compat() - Check if new mount options are allowed
1532 * security_sb_remount() - Verify no incompatible mount changes during remount
1549 * security_sb_kern_mount() - Check if a kernel mount is allowed
1562 * security_sb_show_options() - Output the mount options for a superblock
1576 * security_sb_statfs() - Check if accessing fs stats is allowed
1590 * security_sb_mount() - Check permission for mounting a filesystem
1613 * security_sb_umount() - Check permission for unmounting a filesystem
1627 * security_sb_pivotroot() - Check permissions for pivoting the rootfs
1642 * security_sb_set_mnt_opts() - Set the mount options for a filesystem
1658 int rc = mnt_opts ? -EOPNOTSUPP : LSM_RET_DEFAULT(sb_set_mnt_opts); in security_sb_set_mnt_opts()
1661 rc = scall->hl->hook.sb_set_mnt_opts(sb, mnt_opts, kern_flags, in security_sb_set_mnt_opts()
1671 * security_sb_clone_mnt_opts() - Duplicate superblock mount options
1692 * security_move_mount() - Check permissions for moving a mount
1707 * security_path_notify() - Check if setting a watch is allowed
1724 * security_inode_alloc() - Allocate an inode LSM blob
1728 * Allocate and attach a security structure to @inode->i_security. The
1754 * security_inode_free() - Free an inode's LSM blob
1764 * a call to security_inode_free(). For this reason the inode->i_security
1772 if (!inode->i_security) in security_inode_free()
1774 call_rcu((struct rcu_head *)inode->i_security, inode_free_by_rcu); in security_inode_free()
1778 * security_dentry_init_security() - Perform dentry initialization
1802 * security_dentry_create_files_as() - Perform dentry initialization
1826 * security_inode_init_security() - Initialize an inode's LSM context
1828 * @dir: parent directory
1842 * slot, the hook function should set ->name to the attribute name suffix
1843 * (e.g. selinux), to allocate ->value (will be freed by the caller) and set it
1844 * to the attribute value, to set ->value_len to the length of the value. If
1847 * -EOPNOTSUPP to skip this processing.
1852 int security_inode_init_security(struct inode *inode, struct inode *dir, in security_inode_init_security() argument
1858 int ret = -EOPNOTSUPP, xattr_count = 0; in security_inode_init_security()
1871 return -ENOMEM; in security_inode_init_security()
1875 ret = scall->hl->hook.inode_init_security(inode, dir, qstr, new_xattrs, in security_inode_init_security()
1877 if (ret && ret != -EOPNOTSUPP) in security_inode_init_security()
1880 * As documented in lsm_hooks.h, -EOPNOTSUPP in this context in security_inode_init_security()
1893 for (; xattr_count > 0; xattr_count--) in security_inode_init_security()
1894 kfree(new_xattrs[xattr_count - 1].value); in security_inode_init_security()
1896 return (ret == -EOPNOTSUPP) ? 0 : ret; in security_inode_init_security()
1901 * security_inode_init_security_anon() - Initialize an anonymous inode
1909 * Return: Returns 0 on success, -EACCES if the security module denies the
1910 * creation of this inode, or another -errno upon other errors.
1922 * security_path_mknod() - Check if creating a special file is allowed
1923 * @dir: parent directory
1933 int security_path_mknod(const struct path *dir, struct dentry *dentry, in security_path_mknod() argument
1936 if (unlikely(IS_PRIVATE(d_backing_inode(dir->dentry)))) in security_path_mknod()
1938 return call_int_hook(path_mknod, dir, dentry, mode, dev); in security_path_mknod()
1943 * security_path_post_mknod() - Update inode security after reg file creation
1957 * security_path_mkdir() - Check if creating a new directory is allowed
1958 * @dir: parent directory
1966 int security_path_mkdir(const struct path *dir, struct dentry *dentry, in security_path_mkdir() argument
1969 if (unlikely(IS_PRIVATE(d_backing_inode(dir->dentry)))) in security_path_mkdir()
1971 return call_int_hook(path_mkdir, dir, dentry, mode); in security_path_mkdir()
1976 * security_path_rmdir() - Check if removing a directory is allowed
1977 * @dir: parent directory
1984 int security_path_rmdir(const struct path *dir, struct dentry *dentry) in security_path_rmdir() argument
1986 if (unlikely(IS_PRIVATE(d_backing_inode(dir->dentry)))) in security_path_rmdir()
1988 return call_int_hook(path_rmdir, dir, dentry); in security_path_rmdir()
1992 * security_path_unlink() - Check if removing a hard link is allowed
1993 * @dir: parent directory
2000 int security_path_unlink(const struct path *dir, struct dentry *dentry) in security_path_unlink() argument
2002 if (unlikely(IS_PRIVATE(d_backing_inode(dir->dentry)))) in security_path_unlink()
2004 return call_int_hook(path_unlink, dir, dentry); in security_path_unlink()
2009 * security_path_symlink() - Check if creating a symbolic link is allowed
2010 * @dir: parent directory
2018 int security_path_symlink(const struct path *dir, struct dentry *dentry, in security_path_symlink() argument
2021 if (unlikely(IS_PRIVATE(d_backing_inode(dir->dentry)))) in security_path_symlink()
2023 return call_int_hook(path_symlink, dir, dentry, old_name); in security_path_symlink()
2027 * security_path_link - Check if creating a hard link is allowed
2045 * security_path_rename() - Check if renaming a file is allowed
2071 * security_path_truncate() - Check if truncating a file is allowed
2082 if (unlikely(IS_PRIVATE(d_backing_inode(path->dentry)))) in security_path_truncate()
2088 * security_path_chmod() - Check if changing the file's mode is allowed
2100 if (unlikely(IS_PRIVATE(d_backing_inode(path->dentry)))) in security_path_chmod()
2106 * security_path_chown() - Check if changing the file's owner/group is allowed
2117 if (unlikely(IS_PRIVATE(d_backing_inode(path->dentry)))) in security_path_chown()
2123 * security_path_chroot() - Check if changing the root directory is allowed
2137 * security_inode_create() - Check if creating a file is allowed
2138 * @dir: the parent directory
2146 int security_inode_create(struct inode *dir, struct dentry *dentry, in security_inode_create() argument
2149 if (unlikely(IS_PRIVATE(dir))) in security_inode_create()
2151 return call_int_hook(inode_create, dir, dentry, mode); in security_inode_create()
2156 * security_inode_post_create_tmpfile() - Update inode security of new tmpfile
2171 * security_inode_link() - Check if creating a hard link is allowed
2173 * @dir: new parent directory
2180 int security_inode_link(struct dentry *old_dentry, struct inode *dir, in security_inode_link() argument
2185 return call_int_hook(inode_link, old_dentry, dir, new_dentry); in security_inode_link()
2189 * security_inode_unlink() - Check if removing a hard link is allowed
2190 * @dir: parent directory
2197 int security_inode_unlink(struct inode *dir, struct dentry *dentry) in security_inode_unlink() argument
2201 return call_int_hook(inode_unlink, dir, dentry); in security_inode_unlink()
2205 * security_inode_symlink() - Check if creating a symbolic link is allowed
2206 * @dir: parent directory
2214 int security_inode_symlink(struct inode *dir, struct dentry *dentry, in security_inode_symlink() argument
2217 if (unlikely(IS_PRIVATE(dir))) in security_inode_symlink()
2219 return call_int_hook(inode_symlink, dir, dentry, old_name); in security_inode_symlink()
2223 * security_inode_mkdir() - Check if creating a new directory is allowed
2224 * @dir: parent directory
2229 * associated with inode structure @dir.
2233 int security_inode_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) in security_inode_mkdir() argument
2235 if (unlikely(IS_PRIVATE(dir))) in security_inode_mkdir()
2237 return call_int_hook(inode_mkdir, dir, dentry, mode); in security_inode_mkdir()
2242 * security_inode_rmdir() - Check if removing a directory is allowed
2243 * @dir: parent directory
2250 int security_inode_rmdir(struct inode *dir, struct dentry *dentry) in security_inode_rmdir() argument
2254 return call_int_hook(inode_rmdir, dir, dentry); in security_inode_rmdir()
2258 * security_inode_mknod() - Check if creating a special file is allowed
2259 * @dir: parent directory
2271 int security_inode_mknod(struct inode *dir, struct dentry *dentry, in security_inode_mknod() argument
2274 if (unlikely(IS_PRIVATE(dir))) in security_inode_mknod()
2276 return call_int_hook(inode_mknod, dir, dentry, mode, dev); in security_inode_mknod()
2280 * security_inode_rename() - Check if renaming a file is allowed
2312 * security_inode_readlink() - Check if reading a symbolic link is allowed
2327 * security_inode_follow_link() - Check if following a symbolic link is allowed
2330 * @rcu: true if in RCU-walk mode
2346 * security_inode_permission() - Check if accessing an inode is allowed
2367 * security_inode_setattr() - Check if setting file attributes is allowed
2389 * security_inode_post_setattr() - Update the inode after a setattr operation
2405 * security_inode_getattr() - Check if getting file attributes is allowed
2414 if (unlikely(IS_PRIVATE(d_backing_inode(path->dentry)))) in security_inode_getattr()
2420 * security_inode_setxattr() - Check if setting file xattrs is allowed
2466 * security_inode_set_acl() - Check if setting posix acls is allowed
2487 * security_inode_post_set_acl() - Update inode security from posix acls set
2504 * security_inode_get_acl() - Check if reading posix acls is allowed
2523 * security_inode_remove_acl() - Check if removing a posix acl is allowed
2542 * security_inode_post_remove_acl() - Update inode security after rm posix acls
2559 * security_inode_post_setxattr() - Update the inode after a setxattr operation
2577 * security_inode_getxattr() - Check if xattr access is allowed
2594 * security_inode_listxattr() - Check if listing xattrs is allowed
2610 * security_inode_removexattr() - Check if removing an xattr is allowed
2651 * security_inode_post_removexattr() - Update the inode after a removexattr op
2665 * security_inode_file_setattr() - check if setting fsxattr is allowed
2680 * security_inode_file_getattr() - check if retrieving fsxattr is allowed
2695 * security_inode_need_killpriv() - Check if security_inode_killpriv() required
2711 * security_inode_killpriv() - The setuid bit is removed, update LSM state
2716 * Called with the dentry->d_inode->i_mutex held.
2728 * security_inode_getsecurity() - Get the xattr security label of an inode
2755 * security_inode_setsecurity() - Set the xattr security label of an inode
2780 * security_inode_listsecurity() - List the xattr security label names
2802 * security_inode_getlsmprop() - Get an inode's LSM data
2814 * security_inode_copy_up() - Create new creds for an overlayfs copy-up op
2815 * @src: union dentry of copy-up file
2832 * security_inode_copy_up_xattr() - Filter xattrs in an overlayfs copy-up op
2833 * @src: union dentry of copy-up file
2840 * Return: Returns 0 to accept the xattr, -ECANCELED to discard the xattr,
2841 * -EOPNOTSUPP if the security module does not know about attribute,
2857 * security_inode_setintegrity() - Set the inode's integrity data
2877 * security_kernfs_init_security() - Init LSM context for a kernfs node
2893 * security_file_permission() - Check file permissions
2906 * memory-mapped files. Security modules must handle this separately if they
2917 * security_file_alloc() - Allocate and init a file's LSM blob
2920 * Allocate and attach a security structure to the file->f_security field. The
2938 * security_file_release() - Perform actions before releasing the file ref
2949 * security_file_free() - Free a file's LSM blob
2952 * Deallocate and free any security structures stored in file->f_security.
2960 blob = file->f_security; in security_file_free()
2962 file->f_security = NULL; in security_file_free()
2968 * security_file_ioctl() - Check if an ioctl is allowed
2970 * @cmd: ioctl cmd
2980 int security_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg) in security_file_ioctl() argument
2982 return call_int_hook(file_ioctl, file, cmd, arg); in security_file_ioctl()
2987 * security_file_ioctl_compat() - Check if an ioctl is allowed in compat mode
2989 * @cmd: ioctl cmd
2992 * Compat version of security_file_ioctl() that correctly handles 32-bit
2993 * processes running on 64-bit kernels.
2997 int security_file_ioctl_compat(struct file *file, unsigned int cmd, in security_file_ioctl_compat() argument
3000 return call_int_hook(file_ioctl_compat, file, cmd, arg); in security_file_ioctl_compat()
3012 if (!(current->personality & READ_IMPLIES_EXEC)) in mmap_prot()
3023 if (!path_noexec(&file->f_path)) { in mmap_prot()
3025 if (file->f_op->mmap_capabilities) { in mmap_prot()
3026 unsigned caps = file->f_op->mmap_capabilities(file); in mmap_prot()
3038 * security_mmap_file() - Check if mmap'ing a file is allowed
3056 * security_mmap_addr() - Check if mmap'ing an address is allowed
3069 * security_file_mprotect() - Check if changing memory protections is allowed
3085 * security_file_lock() - Check if a file lock is allowed
3087 * @cmd: lock operation (e.g. F_RDLCK, F_WRLCK)
3094 int security_file_lock(struct file *file, unsigned int cmd) in security_file_lock() argument
3096 return call_int_hook(file_lock, file, cmd); in security_file_lock()
3100 * security_file_fcntl() - Check if fcntl() op is allowed
3102 * @cmd: fcntl command
3105 * Check permission before allowing the file operation specified by @cmd from
3113 int security_file_fcntl(struct file *file, unsigned int cmd, unsigned long arg) in security_file_fcntl() argument
3115 return call_int_hook(file_fcntl, file, cmd, arg); in security_file_fcntl()
3119 * security_file_set_fowner() - Set the file owner info in the LSM blob
3122 * Save owner security information (typically from current->security) in
3123 * file->f_security for later use by the send_sigiotask hook.
3125 * This hook is called with file->f_owner.lock held.
3135 * security_file_send_sigiotask() - Check if sending SIGIO/SIGURG is allowed
3138 * @sig: signal to be sent, SIGIO is sent if 0
3149 struct fown_struct *fown, int sig) in security_file_send_sigiotask() argument
3151 return call_int_hook(file_send_sigiotask, tsk, fown, sig); in security_file_send_sigiotask()
3155 * security_file_receive() - Check if receiving a file via IPC is allowed
3169 * security_file_open() - Save open() time state for late use by the LSM
3172 * Save open-time permission checking state for later use upon file_permission,
3176 * directly or indirectly (e.g. ELF's ld.so) by checking file->f_flags &
3187 * security_file_post_open() - Evaluate a file after it has been opened
3204 * security_file_truncate() - Check if truncating a file is allowed
3219 * security_task_alloc() - Allocate a task's LSM blob
3223 * Handle allocation of task-related resources.
3240 * security_task_free() - Free a task's LSM blob and related resources
3243 * Handle release of task-related resources. Note that this can be called from
3250 kfree(task->security); in security_task_free()
3251 task->security = NULL; in security_task_free()
3255 * security_cred_alloc_blank() - Allocate the min memory to allow cred_transfer
3278 * security_cred_free() - Free the cred's LSM blob and associated resources
3281 * Deallocate and clear the cred->security field in a set of credentials.
3287 * may result in a call here with ->security being NULL. in security_cred_free()
3289 if (unlikely(cred->security == NULL)) in security_cred_free()
3294 kfree(cred->security); in security_cred_free()
3295 cred->security = NULL; in security_cred_free()
3299 * security_prepare_creds() - Prepare a new set of credentials
3322 * security_transfer_creds() - Transfer creds
3334 * security_cred_getsecid() - Get the secid from a set of credentials
3349 * security_cred_getlsmprop() - Get the LSM data from a set of credentials
3364 * security_kernel_act_as() - Set the kernel credentials to act as secid
3379 * security_kernel_create_files_as() - Set file creation context using an inode
3395 * security_kernel_module_request() - Check if loading a module is allowed
3409 * security_kernel_read_file() - Read a file specified by userspace
3426 * security_kernel_post_read_file() - Read a file specified by userspace
3446 * security_kernel_load_data() - Load data provided by userspace
3461 * security_kernel_post_load_data() - Load userspace data from a non-file source
3467 * Load data provided by a non-file source (usually userspace buffer). This
3483 * security_task_fix_setuid() - Update LSM with new user id attributes
3492 * rather than to @current->cred.
3503 * security_task_fix_setgid() - Update LSM with new group id attributes
3512 * @current->cred.
3523 * security_task_fix_setgroups() - Update LSM with new supplementary groups
3530 * @current->cred.
3540 * security_task_setpgid() - Check if setting the pgid is allowed
3555 * security_task_getpgid() - Check if getting the pgid is allowed
3569 * security_task_getsid() - Check if getting the session id is allowed
3582 * security_current_getlsmprop_subj() - Current task's subjective LSM data
3596 * security_task_getlsmprop_obj() - Get a task's objective LSM data
3611 * security_task_setnice() - Check if setting a task's nice value is allowed
3625 * security_task_setioprio() - Check if setting a task's ioprio is allowed
3639 * security_task_getioprio() - Check if getting a task's ioprio is allowed
3652 * security_task_prlimit() - Check if get/setting resources limits is allowed
3669 * security_task_setrlimit() - Check if setting a new rlimit value is allowed
3676 * dereferencing (p->signal->rlim + resource).
3687 * security_task_setscheduler() - Check if setting sched policy/param is allowed
3701 * security_task_getscheduler() - Check if getting scheduling info is allowed
3714 * security_task_movememory() - Check if moving memory is allowed
3727 * security_task_kill() - Check if sending a signal is allowed
3730 * @sig: signal value
3733 * Check permission before sending signal @sig to @p. @info can be NULL, the
3742 int sig, const struct cred *cred) in security_task_kill() argument
3744 return call_int_hook(task_kill, p, info, sig, cred); in security_task_kill()
3748 * security_task_prctl() - Check if a prctl op is allowed
3758 * Return: Return -ENOSYS if no-one wanted to handle this op, any other value
3769 thisrc = scall->hl->hook.task_prctl(option, arg2, arg3, arg4, arg5); in security_task_prctl()
3780 * security_task_to_inode() - Set the security attributes of a task's inode
3793 * security_create_user_ns() - Check if creating a new userns is allowed
3806 * security_ipc_permission() - Check if sysv ipc access is allowed
3820 * security_ipc_getlsmprop() - Get the sysv ipc object LSM data
3834 * security_msg_msg_alloc() - Allocate a sysv ipc message LSM blob
3837 * Allocate and attach a security structure to the msg->security field. The
3855 * security_msg_msg_free() - Free a sysv ipc message LSM blob
3863 kfree(msg->security); in security_msg_msg_free()
3864 msg->security = NULL; in security_msg_msg_free()
3868 * security_msg_queue_alloc() - Allocate a sysv ipc msg queue LSM blob
3889 * security_msg_queue_free() - Free a sysv ipc msg queue LSM blob
3892 * Deallocate security field @perm->security for the message queue.
3897 kfree(msq->security); in security_msg_queue_free()
3898 msq->security = NULL; in security_msg_queue_free()
3902 * security_msg_queue_associate() - Check if a msg queue operation is allowed
3918 * security_msg_queue_msgctl() - Check if a msg queue operation is allowed
3920 * @cmd: operation
3922 * Check permission when a message control operation specified by @cmd is to be
3927 int security_msg_queue_msgctl(struct kern_ipc_perm *msq, int cmd) in security_msg_queue_msgctl() argument
3929 return call_int_hook(msg_queue_msgctl, msq, cmd); in security_msg_queue_msgctl()
3933 * security_msg_queue_msgsnd() - Check if sending a sysv ipc message is allowed
3950 * security_msg_queue_msgrcv() - Check if receiving a sysv ipc msg is allowed
3971 * security_shm_alloc() - Allocate a sysv shm LSM blob
3992 * security_shm_free() - Free a sysv shm LSM blob
3995 * Deallocate the security structure @perm->security for the memory segment.
4000 kfree(shp->security); in security_shm_free()
4001 shp->security = NULL; in security_shm_free()
4005 * security_shm_associate() - Check if a sysv shm operation is allowed
4022 * security_shm_shmctl() - Check if a sysv shm operation is allowed
4024 * @cmd: operation
4026 * Check permission when a shared memory control operation specified by @cmd is
4031 int security_shm_shmctl(struct kern_ipc_perm *shp, int cmd) in security_shm_shmctl() argument
4033 return call_int_hook(shm_shmctl, shp, cmd); in security_shm_shmctl()
4037 * security_shm_shmat() - Check if a sysv shm attach operation is allowed
4055 * security_sem_alloc() - Allocate a sysv semaphore LSM blob
4076 * security_sem_free() - Free a sysv semaphore LSM blob
4079 * Deallocate security structure @sma->security for the semaphore.
4084 kfree(sma->security); in security_sem_free()
4085 sma->security = NULL; in security_sem_free()
4089 * security_sem_associate() - Check if a sysv semaphore operation is allowed
4105 * security_sem_semctl() - Check if a sysv semaphore operation is allowed
4107 * @cmd: operation
4109 * Check permission when a semaphore operation specified by @cmd is to be
4114 int security_sem_semctl(struct kern_ipc_perm *sma, int cmd) in security_sem_semctl() argument
4116 return call_int_hook(sem_semctl, sma, cmd); in security_sem_semctl()
4120 * security_sem_semop() - Check if a sysv semaphore operation is allowed
4138 * security_d_instantiate() - Populate an inode's LSM state based on a dentry
4157 * security_getselfattr - Read an LSM attribute of the current process.
4159 * @uctx: the user-space destination for the information, or NULL
4170 * If @size is insufficient to contain the data -E2BIG is returned.
4187 return -EINVAL; in security_getselfattr()
4189 return -EINVAL; in security_getselfattr()
4191 return -EFAULT; in security_getselfattr()
4198 return -EINVAL; in security_getselfattr()
4200 return -EFAULT; in security_getselfattr()
4205 return -EINVAL; in security_getselfattr()
4214 if (single && lctx.id != scall->hl->lsmid->id) in security_getselfattr()
4219 rc = scall->hl->hook.getselfattr(attr, uctx, &entrysize, flags); in security_getselfattr()
4220 if (rc == -EOPNOTSUPP) in security_getselfattr()
4222 if (rc == -E2BIG) { in security_getselfattr()
4229 left -= entrysize; in security_getselfattr()
4237 return -EFAULT; in security_getselfattr()
4239 return -E2BIG; in security_getselfattr()
4250 * security_setselfattr - Set an LSM attribute on the current process.
4252 * @uctx: the user-space source for the information
4259 * Returns 0 on success, -EINVAL if the input is inconsistent, -EFAULT
4272 return -EINVAL; in security_setselfattr()
4274 return -EINVAL; in security_setselfattr()
4276 return -E2BIG; in security_setselfattr()
4282 if (size < lctx->len || in security_setselfattr()
4283 check_add_overflow(sizeof(*lctx), lctx->ctx_len, &required_len) || in security_setselfattr()
4284 lctx->len < required_len) { in security_setselfattr()
4285 rc = -EINVAL; in security_setselfattr()
4290 if ((scall->hl->lsmid->id) == lctx->id) { in security_setselfattr()
4291 rc = scall->hl->hook.setselfattr(attr, lctx, size, flags); in security_setselfattr()
4301 * security_getprocattr() - Read an attribute for a task
4317 if (lsmid != 0 && lsmid != scall->hl->lsmid->id) in security_getprocattr()
4319 return scall->hl->hook.getprocattr(p, name, value); in security_getprocattr()
4325 * security_setprocattr() - Set an attribute for a task
4341 if (lsmid != 0 && lsmid != scall->hl->lsmid->id) in security_setprocattr()
4343 return scall->hl->hook.setprocattr(name, value, size); in security_setprocattr()
4349 * security_ismaclabel() - Check if the named attribute is a MAC label
4363 * security_secid_to_secctx() - Convert a secid to a secctx
4381 * security_lsmprop_to_secctx() - Convert a lsm_prop to a secctx
4404 if (lsmid != LSM_ID_UNDEF && lsmid != scall->hl->lsmid->id) in security_lsmprop_to_secctx()
4406 return scall->hl->hook.lsmprop_to_secctx(prop, cp); in security_lsmprop_to_secctx()
4413 * security_secctx_to_secid() - Convert a secctx to a secid
4430 * security_release_secctx() - Free a secctx buffer
4443 * security_inode_invalidate_secctx() - Invalidate an inode's security label
4456 * security_inode_notifysecctx() - Notify the LSM of an inode's security label
4466 * Must be called with inode->i_mutex locked.
4477 * security_inode_setsecctx() - Change the security label of an inode
4488 * inode->i_mutex locked.
4499 * security_inode_getsecctx() - Get the security label of an inode
4517 * security_post_notification() - Check if a watch notification can be posted
4536 * security_watch_key() - Check if a task is allowed to watch for key events
4552 * security_netlink_send() - Save info and check if netlink sending is allowed
4570 * security_unix_stream_connect() - Check if a AF_UNIX stream is allowed
4598 * security_unix_may_send() - Check if AF_UNIX socket can send datagrams
4624 * security_socket_create() - Check if creating a new socket is allowed
4640 * security_socket_post_create() - Initialize a newly created socket
4647 * This hook allows a module to update or allocate a per-socket security
4651 * and attach security information to SOCK_INODE(sock)->i_security. This hook
4652 * may be used to update the SOCK_INODE(sock)->i_security field with additional
4665 * security_socket_socketpair() - Check if creating a socketpair is allowed
4681 * security_socket_bind() - Check if a socket bind operation is allowed
4699 * security_socket_connect() - Check if a socket connect operation is allowed
4716 * security_socket_listen() - Check if a socket is allowed to listen
4730 * security_socket_accept() - Check if a socket is allowed to accept connections
4746 * security_socket_sendmsg() - Check if sending a message is allowed
4761 * security_socket_recvmsg() - Check if receiving a message is allowed
4778 * security_socket_getsockname() - Check if reading the socket addr is allowed
4792 * security_socket_getpeername() - Check if reading the peer's addr is allowed
4805 * security_socket_getsockopt() - Check if reading a socket option is allowed
4821 * security_socket_setsockopt() - Check if setting a socket option is allowed
4836 * security_socket_shutdown() - Checks if shutting down the socket is allowed
4851 * security_sock_rcv_skb() - Check if an incoming network packet is allowed
4869 * security_socket_getpeersec_stream() - Get the remote peer label
4891 * security_socket_getpeersec_dgram() - Get the remote peer label
4897 * for udp sockets on a per-packet basis to userspace via getsockopt
4912 * lsm_sock_alloc - allocate a composite sock blob
4918 * Returns 0, or -ENOMEM if memory can't be allocated.
4922 return lsm_blob_alloc(&sock->sk_security, blob_sizes.lbs_sock, gfp); in lsm_sock_alloc()
4926 * security_sk_alloc() - Allocate and initialize a sock's LSM blob
4931 * Allocate and attach a security structure to the sk->sk_security field, which
4949 * security_sk_free() - Free the sock's LSM blob
4957 kfree(sk->sk_security); in security_sk_free()
4958 sk->sk_security = NULL; in security_sk_free()
4962 * security_sk_clone() - Clone a sock's LSM state
4975 * security_sk_classify_flow() - Set a flow's secid based on socket
4983 call_void_hook(sk_getsecid, sk, &flic->flowic_secid); in security_sk_classify_flow()
4988 * security_req_classify_flow() - Set a flow's secid based on request_sock
5002 * security_sock_graft() - Reconcile LSM state when grafting a sock on a socket
5016 * security_inet_conn_request() - Set request_sock state using incoming connect
5033 * security_inet_csk_clone() - Set new sock LSM state based on request_sock
5046 * security_inet_conn_established() - Update sock's LSM state with connection
5060 * security_secmark_relabel_packet() - Check if setting a secmark is allowed
5074 * security_secmark_refcount_inc() - Increment the secmark labeling rule count
5085 * security_secmark_refcount_dec() - Decrement the secmark labeling rule count
5096 * security_tun_dev_alloc_security() - Allocate a LSM blob for a TUN device
5122 * security_tun_dev_free_security() - Free a TUN device LSM blob
5134 * security_tun_dev_create() - Check if creating a TUN device is allowed
5147 * security_tun_dev_attach_queue() - Check if attaching a TUN queue is allowed
5161 * security_tun_dev_attach() - Update TUN device LSM state on attach
5177 * security_tun_dev_open() - Update TUN device LSM state on open
5192 * security_sctp_assoc_request() - Update the LSM on a SCTP association req
5196 * Passes the @asoc and @chunk->skb of the association INIT packet to the LSM.
5208 * security_sctp_bind_connect() - Validate a list of addrs for a SCTP option
5229 * security_sctp_sk_clone() - Clone a SCTP sock's LSM state
5246 * security_sctp_assoc_established() - Update LSM state when assoc established
5250 * Passes the @asoc and @chunk->skb of the association COOKIE_ACK packet to the
5263 * security_mptcp_add_subflow() - Inherit the LSM label from the MPTCP socket
5283 * security_ib_pkey_access() - Check if access to an IB pkey is allowed
5299 * security_ib_endport_manage_subnet() - Check if SMPs traffic is allowed
5316 * security_ib_alloc_security() - Allocate an Infiniband LSM blob
5321 * Return: Returns 0 on success, non-zero on failure.
5341 * security_ib_free_security() - Free an Infiniband LSM blob
5355 * security_xfrm_policy_alloc() - Allocate a xfrm policy LSM blob
5360 * Allocate a security structure to the xp->security field; the security field
5374 * security_xfrm_policy_clone() - Clone xfrm policy LSM state
5390 * security_xfrm_policy_free() - Free a xfrm security context
5402 * security_xfrm_policy_delete() - Check if deleting a xfrm policy is allowed
5415 * security_xfrm_state_alloc() - Allocate a xfrm state LSM blob
5419 * Allocate a security structure to the @x->security field; the security field
5433 * security_xfrm_state_alloc_acquire() - Allocate a xfrm state LSM blob
5438 * Allocate a security structure to the x->security field; the security field
5451 * security_xfrm_state_delete() - Check if deleting a xfrm state is allowed
5454 * Authorize deletion of x->security.
5465 * security_xfrm_state_free() - Free a xfrm state
5468 * Deallocate x->security.
5476 * security_xfrm_policy_lookup() - Check if using a xfrm policy is allowed
5481 * packet. The hook is called when selecting either a per-socket policy or a
5484 * Return: Return 0 if permission is granted, -ESRCH otherwise, or -errno on
5493 * security_xfrm_state_pol_flow_match() - Check for a xfrm match
5519 rc = scall->hl->hook.xfrm_state_pol_flow_match(x, xp, flic); in security_xfrm_state_pol_flow_match()
5526 * security_xfrm_decode_session() - Determine the xfrm secid for a packet
5541 int rc = call_int_hook(xfrm_decode_session, skb, &flic->flowic_secid, in security_skb_classify_flow()
5551 * security_key_alloc() - Allocate and initialize a kernel key LSM blob
5559 * Return: Return 0 if permission is granted, -ve error otherwise.
5575 * security_key_free() - Free a kernel key LSM blob
5582 kfree(key->security); in security_key_free()
5583 key->security = NULL; in security_key_free()
5587 * security_key_permission() - Check if a kernel key operation is allowed
5594 * Return: Return 0 if permission is granted, -ve error otherwise.
5603 * security_key_getsecurity() - Get the key's security label
5609 * storage for the NUL-terminated string and the caller should free it.
5611 * Return: Returns the length of @buffer (including terminating NUL) or -ve if
5622 * security_key_post_create_or_update() - Notification of key create or update
5643 * security_audit_rule_init() - Allocate and init an LSM audit rule struct
5652 * Return: Return 0 if @lsmrule has been successfully set, -EINVAL in case of
5662 * security_audit_rule_known() - Check if an audit rule contains LSM fields
5676 * security_audit_rule_free() - Free an LSM audit rule struct
5688 * security_audit_rule_match() - Check if a label matches an audit rule
5697 * Return: Returns 1 if secid matches the rule, 0 if it does not, -ERRNO on
5709 * security_bpf() - Check if the bpf syscall operation is allowed
5710 * @cmd: command
5717 * check the specific cmd they need.
5721 int security_bpf(int cmd, union bpf_attr *attr, unsigned int size, bool kernel) in security_bpf() argument
5723 return call_int_hook(bpf, cmd, attr, size, kernel); in security_bpf()
5727 * security_bpf_map() - Check if access to a bpf map is allowed
5742 * security_bpf_prog() - Check if access to a bpf program is allowed
5756 * security_bpf_map_create() - Check if BPF map creation is allowed
5783 * security_bpf_prog_load() - Check if loading of BPF program is allowed
5811 * security_bpf_token_create() - Check if creating of BPF token is allowed
5837 * security_bpf_token_cmd() - Check if BPF token is allowed to delegate
5840 * @cmd: BPF syscall command requested to be delegated by BPF token
5847 int security_bpf_token_cmd(const struct bpf_token *token, enum bpf_cmd cmd) in security_bpf_token_cmd() argument
5849 return call_int_hook(bpf_token_cmd, token, cmd); in security_bpf_token_cmd()
5853 * security_bpf_token_capable() - Check if BPF token is allowed to delegate
5854 * requested BPF-related capability
5859 * delegation of requested BPF-related capabilities.
5869 * security_bpf_map_free() - Free a bpf map's LSM blob
5877 kfree(map->security); in security_bpf_map_free()
5878 map->security = NULL; in security_bpf_map_free()
5882 * security_bpf_prog_free() - Free a BPF program's LSM blob
5890 kfree(prog->aux->security); in security_bpf_prog_free()
5891 prog->aux->security = NULL; in security_bpf_prog_free()
5895 * security_bpf_token_free() - Free a BPF token's LSM blob
5903 kfree(token->security); in security_bpf_token_free()
5904 token->security = NULL; in security_bpf_token_free()
5909 * security_locked_down() - Check if a kernel feature is allowed
5924 * security_bdev_alloc() - Allocate a block device LSM blob
5927 * Allocate and attach a security structure to @bdev->bd_security. The
5950 * security_bdev_free() - Free a block device's LSM blob
5953 * Deallocate the bdev security structure and set @bdev->bd_security to NULL.
5957 if (!bdev->bd_security) in security_bdev_free()
5962 kfree(bdev->bd_security); in security_bdev_free()
5963 bdev->bd_security = NULL; in security_bdev_free()
5968 * security_bdev_setintegrity() - Set the device's integrity data
5977 * information is updated to keep these data current. For example, in dm-verity,
5978 * if the mapping table is reloaded and configured to use a different dm-verity
5980 * data in the LSM blob will become obsolete. It is crucial to re-invoke the
5982 * arises from the design of device-mapper, where a device-mapper device is
6004 * security_perf_event_open() - Check if a perf event open is allowed
6017 * security_perf_event_alloc() - Allocate a perf event LSM blob
6028 rc = lsm_blob_alloc(&event->security, blob_sizes.lbs_perf_event, in security_perf_event_alloc()
6035 kfree(event->security); in security_perf_event_alloc()
6036 event->security = NULL; in security_perf_event_alloc()
6042 * security_perf_event_free() - Free a perf event LSM blob
6049 kfree(event->security); in security_perf_event_free()
6050 event->security = NULL; in security_perf_event_free()
6054 * security_perf_event_read() - Check if reading a perf event label is allowed
6067 * security_perf_event_write() - Check if writing a perf event label is allowed
6082 * security_uring_override_creds() - Check if overriding creds is allowed
6096 * security_uring_sqpoll() - Check if IORING_SETUP_SQPOLL is allowed
6109 * security_uring_cmd() - Check if a io_uring passthrough command is allowed
6122 * security_uring_allowed() - Check if io_uring_setup() is allowed
6135 * security_initramfs_populated() - Notify LSMs that initramfs has been loaded