Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:moyo_write_file - Update file related list.*@param: Pointer to "struct tomoyo_acl_param".* Returns 0 on success, negative value otherwise.* Caller holds tomoyo_read_lock().

Proto:int tomoyo_write_file(struct tomoyo_acl_param *param)

Type:int

Parameter:

TypeParameterName
struct tomoyo_acl_param *param
1014  perm = 0
1016  operation = tomoyo_read_token(param)
1018  When type < TOMOYO_MAX_PATH_OPERATION cycle If tomoyo_permstr(operation, String table for path operation. [type]) Then
1020  perm |= 1 << type
1021  If perm Then Return moyo_update_path_acl - Update "struct tomoyo_path_acl" list.*@perm: Permission.*@param: Pointer to "struct tomoyo_acl_param".* Returns 0 on success, negative value otherwise.* Caller holds tomoyo_read_lock().
1023  When type < TOMOYO_MAX_PATH2_OPERATION cycle If tomoyo_permstr(operation, String table for /sys/kernel/security/tomoyo/profile [Mapping table from "enum tomoyo_path2_acl_index" to "enum tomoyo_mac_index".[type]]) Then
1026  perm |= 1 << type
1027  If perm Then Return moyo_update_path2_acl - Update "struct tomoyo_path2_acl" list.*@perm: Permission.*@param: Pointer to "struct tomoyo_acl_param".* Returns 0 on success, negative value otherwise.* Caller holds tomoyo_read_lock().
1029  When type < TOMOYO_MAX_PATH_NUMBER_OPERATION cycle If tomoyo_permstr(operation, String table for /sys/kernel/security/tomoyo/profile [Mapping table from "enum tomoyo_path_number_acl_index" to* "enum tomoyo_mac_index".[type]]) Then
1032  perm |= 1 << type
1033  If perm Then Return moyo_update_path_number_acl - Update ioctl/chmod/chown/chgrp ACL.*@perm: Permission.*@param: Pointer to "struct tomoyo_acl_param".* Returns 0 on success, negative value otherwise.
1035  When type < TOMOYO_MAX_MKDEV_OPERATION cycle If tomoyo_permstr(operation, String table for /sys/kernel/security/tomoyo/profile [Mapping table from "enum tomoyo_mkdev_acl_index" to "enum tomoyo_mac_index".[type]]) Then
1038  perm |= 1 << type
1039  If perm Then Return moyo_update_mkdev_acl - Update "struct tomoyo_mkdev_acl" list.*@perm: Permission.*@param: Pointer to "struct tomoyo_acl_param".* Returns 0 on success, negative value otherwise.* Caller holds tomoyo_read_lock().
1041  If tomoyo_permstr(operation, String table for /sys/kernel/security/tomoyo/profile [TOMOYO_MAC_FILE_MOUNT]) Then Return moyo_update_mount_acl - Write "struct tomoyo_mount_acl" list.*@param: Pointer to "struct tomoyo_acl_param".* Returns 0 on success, negative value otherwise.* Caller holds tomoyo_read_lock().
1044  Return -EINVAL