函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:moyo_check_open_permission - Check permission for "read" and "write".*@domain: Pointer to "struct tomoyo_domain_info".*@path: Pointer to "struct path".*@flag: Flags for open().* Returns 0 on success, negative value otherwise.

函数原型:int tomoyo_check_open_permission(struct tomoyo_domain_info *domain, const struct path *path, const int flag)

返回类型:int

参数:

类型参数名称
struct tomoyo_domain_info *domain
const struct path *path
const intflag
756  acc_mode等于ACC_MODE(flag)
757  error等于0
760  struct tomoyo_obj_info obj = { First pathname. Initialized with { NULL, NULL } if no path. = {mnt = mnt, dentry = dentry}, }
765  name = NULL
766  One of tomoyo_mode_index . 等于TOMOYO_CONFIG_DISABLED
767  idx等于moyo_read_lock - Take lock for protecting policy.* Returns index number for tomoyo_read_unlock().
768  如果acc_modetomoyo_init_request_info( & r, domain, TOMOYO_MAC_FILE_OPEN)不等于TOMOYO_CONFIG_DISABLED
772  error等于负ENOMEM
773  转到:out
775  For holding parameters specific to operations which deal files.* NULL if not dealing files.等于obj
776  如果acc_mode按位与MAY_READerror等于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().
779  如果非erroracc_mode按位与MAY_WRITEerror等于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().
785  out :
786  释放内存
787  moyo_read_unlock - Release lock for protecting policy.*@idx: Index number returned by tomoyo_read_lock().* Returns nothing.
788  如果One of tomoyo_mode_index . 不等于TOMOYO_CONFIG_ENFORCINGerror等于0
790  返回:error
调用者
名称描述
tomoyo_bprm_check_securitymoyo_bprm_check_security - Target for security_bprm_check().*@bprm: Pointer to "struct linux_binprm".* Returns 0 on success, negative value otherwise.
tomoyo_file_fcntlmoyo_file_fcntl - Target for security_file_fcntl().*@file: Pointer to "struct file".*@cmd: Command for fcntl().*@arg: Argument for @cmd.* Returns 0 on success, negative value otherwise.
tomoyo_file_openmoyo_file_open - Target for security_file_open().*@f: Pointer to "struct file".*@cred: Pointer to "struct cred".* Returns 0 on success, negative value otherwise.