函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\tomoyo\file.c Create Date:2022-07-27 21:10:56
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:moyo_path_perm - Check permission for "unlink", "rmdir", "truncate", "symlink", "append", "chroot" and "unmount".*@operation: Type of operation.*@path: Pointer to "struct path".*@target: Symlink's target if @operation is TOMOYO_TYPE_SYMLINK,

函数原型:int tomoyo_path_perm(const u8 operation, const struct path *path, const char *target)

返回类型:int

参数:

类型参数名称
const u8operation
const struct path *path
const char *target
806  struct tomoyo_obj_info obj = { First pathname. Initialized with { NULL, NULL } if no path. = {mnt = mnt, dentry = dentry}, }
815  如果tomoyo_init_request_info( & r, NULL, Mapping table from "enum tomoyo_path_acl_index" to "enum tomoyo_mac_index".[operation])恒等于TOMOYO_CONFIG_DISABLED则返回:0
818  is_enforce等于One of tomoyo_mode_index . 恒等于TOMOYO_CONFIG_ENFORCING
819  error等于负ENOMEM
820  name = NULL
821  idx等于moyo_read_lock - Take lock for protecting policy.* Returns index number for tomoyo_read_unlock().
822  如果非moyo_get_realpath - Get realpath.*@buf: Pointer to "struct tomoyo_path_info".*@path: Pointer to "struct path".* Returns true on success, false otherwise.则转到:out
824  For holding parameters specific to operations which deal files.* NULL if not dealing files.等于obj
826  :operation恒等于TOMOYO_TYPE_RMDIR
827  :operation恒等于TOMOYO_TYPE_CHROOT
828  moyo_add_slash - Add trailing '/' if needed.*@buf: Pointer to "struct tomoyo_path_info".* Returns nothing.*@buf must be generated by tomoyo_encode() because this function does not* allocate memory for adding '/'.
829  退出
830  :operation恒等于TOMOYO_TYPE_SYMLINK
831  name等于tomoyo_encode(target)
832  如果非name则转到:out
834  tomoyo_fill_path_info( & symlink_target)
835  * Content of symbolic link to be created. NULL for operations other * than symlink().等于symlink_target
836  退出
838  error等于moyo_path_permission - Check permission for single path operation.*@r: Pointer to "struct tomoyo_request_info".*@operation: Type of operation.*@filename: Filename to check.* Returns 0 on success, negative value otherwise.* Caller holds tomoyo_read_lock().
839  如果operation恒等于TOMOYO_TYPE_SYMLINK释放内存
841  out :
842  释放内存
843  moyo_read_unlock - Release lock for protecting policy.*@idx: Index number returned by tomoyo_read_lock().* Returns nothing.
844  如果非is_enforceerror等于0
846  返回:error
调用者
名称描述
tomoyo_inode_getattrmoyo_inode_getattr - Target for security_inode_getattr().*@mnt: Pointer to "struct vfsmount".*@dentry: Pointer to "struct dentry".* Returns 0 on success, negative value otherwise.
tomoyo_path_truncatemoyo_path_truncate - Target for security_path_truncate().*@path: Pointer to "struct path".* Returns 0 on success, negative value otherwise.
tomoyo_path_unlinkmoyo_path_unlink - Target for security_path_unlink().*@parent: Pointer to "struct path".*@dentry: Pointer to "struct dentry".* Returns 0 on success, negative value otherwise.
tomoyo_path_rmdirmoyo_path_rmdir - Target for security_path_rmdir().*@parent: Pointer to "struct path".*@dentry: Pointer to "struct dentry".* Returns 0 on success, negative value otherwise.
tomoyo_path_symlinkmoyo_path_symlink - Target for security_path_symlink().*@parent: Pointer to "struct path".*@dentry: Pointer to "struct dentry".*@old_name: Symlink's content.* Returns 0 on success, negative value otherwise.
tomoyo_path_chrootmoyo_path_chroot - Target for security_path_chroot().*@path: Pointer to "struct path".* Returns 0 on success, negative value otherwise.
tomoyo_sb_umountmoyo_sb_umount - Target for security_sb_umount().*@mnt: Pointer to "struct vfsmount".*@flags: Unmount options.* Returns 0 on success, negative value otherwise.