Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:moyo_path_number_perm - Check permission for "create", "mkdir", "mkfifo", "mksock", "ioctl", "chmod", "chown", "chgrp".*@type: Type of operation.*@path: Pointer to "struct path".*@number: Number.* Returns 0 on success, negative value otherwise.

Proto:int tomoyo_path_number_perm(const u8 type, const struct path *path, unsigned long number)

Type:int

Parameter:

TypeParameterName
const u8type
const struct path *path
unsigned longnumber
712  struct tomoyo_obj_info obj = { First pathname. Initialized with { NULL, NULL } if no path. = {mnt = mnt, dentry = dentry}, }
715  error = -ENOMEM
719  If tomoyo_init_request_info( & r, NULL, Mapping table from "enum tomoyo_path_number_acl_index" to* "enum tomoyo_mac_index".[type]) == TOMOYO_CONFIG_DISABLED || Not dentry Then Return 0
722  idx = moyo_read_lock - Take lock for protecting policy.* Returns index number for tomoyo_read_unlock().
723  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
725  For holding parameters specific to operations which deal files.* NULL if not dealing files. = obj
726  If type == TOMOYO_TYPE_MKDIR Then 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 '/'.
728  param_type = TOMOYO_TYPE_PATH_NUMBER_ACL
729  * One of values in * "enum tomoyo_path_number_acl_index". = type
730  filename = buf
731  number = number
732  Do
733  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().
734  error = moyo_audit_path_number_log - Audit path/number request log.*@r: Pointer to "struct tomoyo_request_info".* Returns 0 on success, negative value otherwise.
735  When 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 cycle
736  kfree(name)
737  out :
738  moyo_read_unlock - Release lock for protecting policy.*@idx: Index number returned by tomoyo_read_lock().* Returns nothing.
739  If One of tomoyo_mode_index . != TOMOYO_CONFIG_ENFORCING Then error = 0
741  Return error
Caller
NameDescribe
tomoyo_path_mkdirmoyo_path_mkdir - Target for security_path_mkdir().*@parent: Pointer to "struct path".*@dentry: Pointer to "struct dentry".*@mode: DAC permission mode.* Returns 0 on success, negative value otherwise.
tomoyo_path_mknodmoyo_path_mknod - Target for security_path_mknod().*@parent: Pointer to "struct path".*@dentry: Pointer to "struct dentry".*@mode: DAC permission mode.*@dev: Device attributes.* Returns 0 on success, negative value otherwise.
tomoyo_file_ioctlmoyo_file_ioctl - Target for security_file_ioctl().*@file: Pointer to "struct file".*@cmd: Command for ioctl().*@arg: Argument for @cmd.* Returns 0 on success, negative value otherwise.
tomoyo_path_chmodmoyo_path_chmod - Target for security_path_chmod().*@path: Pointer to "struct path".*@mode: DAC permission mode.* Returns 0 on success, negative value otherwise.
tomoyo_path_chownmoyo_path_chown - Target for security_path_chown().*@path: Pointer to "struct path".*@uid: Owner ID.*@gid: Group ID.* Returns 0 on success, negative value otherwise.