函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\tomoyo\domain.c Create Date:2022-07-27 21:08:37
Last Modify:2022-05-23 20:14:46 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称: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.

函数原型: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 ))

返回类型:int

参数:

类型参数名称
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等于如果is_delete则负ENOENT否则负ENOMEM
105  list等于list
107  如果data[0]则
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  如果非 Maybe NULL. 则返回:负EINVAL
118  __mptr等于new_entry
118  循环
118  当0循环
118  })->perm == 1 << TOMOYO_TYPE_EXECUTE))
119  转到:out
121  如果mutex_lock_interruptible( & tomoyo_policy_lock)则转到:out
125  如果 true or false or TOMOYO_GC_IN_PROGRESS 恒等于Garbage collector is trying to kfree() this element. 则继续下一循环
127  如果非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.或非check_duplicate(entry, new_entry)则继续下一循环
130  如果merge_duplicate true or false or TOMOYO_GC_IN_PROGRESS 等于merge_duplicate(entry, new_entry, is_delete)
133  否则 true or false or TOMOYO_GC_IN_PROGRESS 等于is_delete
135  error等于0
136  退出
138  如果error且非is_delete
139  entry等于tomoyo_commit_ok(new_entry, size)
140  如果entry
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  返回:error
调用者
名称描述
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().