Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\tomoyo\file.c Create Date:2022-07-28 19:42:01
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name: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,

Proto:int tomoyo_path_perm(const u8 operation, const struct path *path, const char *target)

Type:int

Parameter:

TypeParameterName
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  If tomoyo_init_request_info( & r, NULL, Mapping table from "enum tomoyo_path_acl_index" to "enum tomoyo_mac_index".[operation]) == TOMOYO_CONFIG_DISABLED Then Return 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  If Not moyo_get_realpath - Get realpath.*@buf: Pointer to "struct tomoyo_path_info".*@path: Pointer to "struct path".* Returns true on success, false otherwise. Then Go to out
824  For holding parameters specific to operations which deal files.* NULL if not dealing files. = obj
826  Case operation == TOMOYO_TYPE_RMDIR
827  Case 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  Break
830  Case operation == TOMOYO_TYPE_SYMLINK
831  name = tomoyo_encode(target)
832  If Not name Then Go to 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  Break
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  If operation == TOMOYO_TYPE_SYMLINK Then kfree(name)
841  out :
842  kfree(name)
843  moyo_read_unlock - Release lock for protecting policy.*@idx: Index number returned by tomoyo_read_lock().* Returns nothing.
844  If Not is_enforce Then error = 0
846  Return error
Caller
NameDescribe
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.