Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

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

Proto:int tomoyo_check_open_permission(struct tomoyo_domain_info *domain, const struct path *path, const int flag)

Type:int

Parameter:

TypeParameterName
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  If acc_mode && tomoyo_init_request_info( & r, domain, TOMOYO_MAC_FILE_OPEN) != TOMOYO_CONFIG_DISABLED Then
772  error = -ENOMEM
773  Go to out
775  For holding parameters specific to operations which deal files.* NULL if not dealing files. = obj
776  If acc_mode & MAY_READ Then 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().
779  If Not error && acc_mode & MAY_WRITE Then 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().
785  out :
786  kfree(name)
787  moyo_read_unlock - Release lock for protecting policy.*@idx: Index number returned by tomoyo_read_lock().* Returns nothing.
788  If One of tomoyo_mode_index . != TOMOYO_CONFIG_ENFORCING Then error = 0
790  Return error
Caller
NameDescribe
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.