函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:moyo_path2_perm - Check permission for "rename", "link" and "pivot_root".*@operation: Type of operation.*@path1: Pointer to "struct path".*@path2: Pointer to "struct path".* Returns 0 on success, negative value otherwise.

函数原型:int tomoyo_path2_perm(const u8 operation, const struct path *path1, const struct path *path2)

返回类型:int

参数:

类型参数名称
const u8operation
const struct path *path1
const struct path *path2
906  error等于负ENOMEM
910  struct tomoyo_obj_info obj = { First pathname. Initialized with { NULL, NULL } if no path. = {mnt = mnt, dentry = dentry}, Second pathname. Initialized with { NULL, NULL } if no path. = {mnt = mnt, dentry = dentry}}
916  如果tomoyo_init_request_info( & r, NULL, Mapping table from "enum tomoyo_path2_acl_index" to "enum tomoyo_mac_index".[operation])恒等于TOMOYO_CONFIG_DISABLED则返回:0
919  name = NULL
920  name = NULL
921  idx等于moyo_read_lock - Take lock for protecting policy.* Returns index number for tomoyo_read_unlock().
922  如果非moyo_get_realpath - Get realpath.*@buf: Pointer to "struct tomoyo_path_info".*@path: Pointer to "struct path".* Returns true on success, false otherwise.或非moyo_get_realpath - Get realpath.*@buf: Pointer to "struct tomoyo_path_info".*@path: Pointer to "struct path".* Returns true on success, false otherwise.则转到:out
926  :operation恒等于TOMOYO_TYPE_RENAME
927  :operation恒等于TOMOYO_TYPE_LINK
928  如果非d_is_dir(dentry)则退出
931  :operation恒等于TOMOYO_TYPE_PIVOT_ROOT
932  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 '/'.
933  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 '/'.
934  退出
936  For holding parameters specific to operations which deal files.* NULL if not dealing files.等于obj
937  param_type等于TOMOYO_TYPE_PATH2_ACL
938  One of values in "enum tomoyo_path2_acl_index". 等于operation
939  filename1等于buf1
940  filename2等于buf2
941  循环
942  moyo_check_acl - Do permission check.*@r: Pointer to "struct tomoyo_request_info".*@check_entry: Callback function to check type specific parameters.* Returns 0 on success, negative value otherwise.* Caller holds tomoyo_read_lock().
943  error等于moyo_audit_path2_log - Audit path/path request log.*@r: Pointer to "struct tomoyo_request_info".* Returns 0 on success, negative value otherwise.
944 error恒等于Retry this request. Returned by tomoyo_supervisor() if policy violation has* occurred in enforcing mode and the userspace daemon decided to retry.* We must choose a positive value in order to distinguish "granted" (which is循环
945  out :
946  释放内存
947  释放内存
948  moyo_read_unlock - Release lock for protecting policy.*@idx: Index number returned by tomoyo_read_lock().* Returns nothing.
949  如果One of tomoyo_mode_index . 不等于TOMOYO_CONFIG_ENFORCINGerror等于0
951  返回:error
调用者
名称描述
tomoyo_path_linkmoyo_path_link - Target for security_path_link().*@old_dentry: Pointer to "struct dentry".*@new_dir: Pointer to "struct path".*@new_dentry: Pointer to "struct dentry".* Returns 0 on success, negative value otherwise.
tomoyo_path_renamemoyo_path_rename - Target for security_path_rename().*@old_parent: Pointer to "struct path".*@old_dentry: Pointer to "struct dentry".*@new_parent: Pointer to "struct path".*@new_dentry: Pointer to "struct dentry".
tomoyo_sb_pivotrootmoyo_sb_pivotroot - Target for security_sb_pivotroot().*@old_path: Pointer to "struct path".*@new_path: Pointer to "struct path".* Returns 0 on success, negative value otherwise.