Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\tomoyo\domain.c Create Date:2022-07-28 19:39:33
Last Modify:2022-05-23 20:14:46 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:moyo_update_domain - Update an entry for domain policy.*@new_entry: Pointer to "struct tomoyo_acl_info".*@size: Size of @new_entry in bytes.*@param: Pointer to "struct tomoyo_acl_param".*@check_duplicate: Callback function to find duplicated entry.

Proto:int tomoyo_update_domain(struct tomoyo_acl_info *new_entry, const int size, struct tomoyo_acl_param *param, bool (*check_duplicate)(const struct tomoyo_acl_info *, const struct tomoyo_acl_info *), bool (*merge_duplicate)(struct tomoyo_acl_info *, struct tomoyo_acl_info *, const bool ))

Type:int

Parameter:

TypeParameterName
struct tomoyo_acl_info *new_entry
const intsize
struct tomoyo_acl_param *param
bool (*check_duplicate
bool (*merge_duplicate
102  is_delete = is_delete
103  error = If is_delete Then -ENOENT Else -ENOMEM
105  list = list
107  If data[0] Then
108  Maybe NULL. = moyo_get_condition - Parse condition part.*@param: Pointer to "struct tomoyo_acl_param".* Returns pointer to "struct tomoyo_condition" on success, NULL otherwise.
109  If Not Maybe NULL. Then Return -EINVAL
118  __mptr = new_entry
118  Do
118  When 0 cycle
118  })->perm == 1 << TOMOYO_TYPE_EXECUTE))
119  Go to out
121  If mutex_lock_interruptible( & tomoyo_policy_lock) Then Go to out
125  If true or false or TOMOYO_GC_IN_PROGRESS == Garbage collector is trying to kfree() this element. Then Continue
127  If Not moyo_same_acl_head - Check for duplicated "struct tomoyo_acl_info" entry.*@a: Pointer to "struct tomoyo_acl_info".*@b: Pointer to "struct tomoyo_acl_info".* Returns true if @a == @b, false otherwise. || Not check_duplicate(entry, new_entry) Then Continue
130  If merge_duplicate Then true or false or TOMOYO_GC_IN_PROGRESS = merge_duplicate(entry, new_entry, is_delete)
133  Else true or false or TOMOYO_GC_IN_PROGRESS = is_delete
135  error = 0
136  Break
138  If error && Not is_delete Then
139  entry = tomoyo_commit_ok(new_entry, size)
140  If entry Then
142  error = 0
145  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
146  out :
147  moyo_put_condition - Drop reference on "struct tomoyo_condition".*@cond: Pointer to "struct tomoyo_condition". Maybe NULL.* Returns nothing.
148  Return error
Caller
NameDescribe
tomoyo_write_envmoyo_write_env - Write "struct tomoyo_env_acl" list.*@param: Pointer to "struct tomoyo_acl_param".* Returns 0 on success, negative value otherwise.* Caller holds tomoyo_read_lock().
tomoyo_update_path_aclmoyo_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().
tomoyo_update_mkdev_aclmoyo_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().
tomoyo_update_path2_aclmoyo_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().
tomoyo_update_path_number_aclmoyo_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.
tomoyo_update_mount_aclmoyo_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().
tomoyo_write_inet_networkmoyo_write_inet_network - Write "struct tomoyo_inet_acl" list.*@param: Pointer to "struct tomoyo_acl_param".* Returns 0 on success, negative value otherwise.* Caller holds tomoyo_read_lock().
tomoyo_write_unix_networkmoyo_write_unix_network - Write "struct tomoyo_unix_acl" list.*@param: Pointer to "struct tomoyo_acl_param".* Returns 0 on success, negative value otherwise.
tomoyo_write_taskmoyo_write_task - Update task related list.*@param: Pointer to "struct tomoyo_acl_param".* Returns 0 on success, negative value otherwise.* Caller holds tomoyo_read_lock().