函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\tomoyo\memory.c Create Date:2022-07-27 21:12:48
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:moyo_get_group - Allocate memory for "struct tomoyo_path_group"/"struct tomoyo_number_group".*@param: Pointer to "struct tomoyo_acl_param".*@idx: Index number.* Returns pointer to "struct tomoyo_group" on success, NULL otherwise.

函数原型:struct tomoyo_group *tomoyo_get_group(struct tomoyo_acl_param *param, const u8 idx)

返回类型:struct tomoyo_group

参数:

类型参数名称
struct tomoyo_acl_param *param
const u8idx
98  struct tomoyo_group e = {}
99  struct tomoyo_group * group = NULL
101  group_name等于tomoyo_read_token(param)
102  bool found = false
104  如果非tomoyo_correct_word(group_name)或idx大于等于TOMOYO_MAX_GROUP则返回:NULL
106  group_name等于moyo_get_name - Allocate permanent memory for string data.*@name: The string to store into the permernent memory.* Returns pointer to "struct tomoyo_path_info" on success, NULL otherwise.
107  如果非group_name则返回:NULL
109  如果mutex_lock_interruptible( & tomoyo_policy_lock)则转到:out
111  list等于 List of "struct tomoyo_group". [idx]
113  如果group_name不等于group_nameatomic_read( & users)恒等于Garbage collector is trying to kfree() this element. 则继续下一循环
116  atomic_inc( & users)
117  found = true
118  退出
120  如果非found
121  entry等于moyo_commit_ok - Check memory quota.*@data: Data to copy from.*@size: Size in byte.* Returns pointer to allocated memory on success, NULL otherwise.*@data is zero-cleared on success.* Caller holds tomoyo_policy_lock mutex.
123  如果entry
125  atomic_set( & users, 1)
127  group等于entry
128  found = true
131  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.
132  out :
133  moyo_put_name - Drop reference on "struct tomoyo_name".*@name: Pointer to "struct tomoyo_path_info". Maybe NULL.* Returns nothing.
134  返回:found ? group : NULL
调用者
名称描述
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_parse_name_unionmoyo_parse_name_union - Parse a tomoyo_name_union.*@param: Pointer to "struct tomoyo_acl_param".*@ptr: Pointer to "struct tomoyo_name_union".* Returns true on success, false otherwise.
tomoyo_parse_number_unionmoyo_parse_number_union - Parse a tomoyo_number_union.*@param: Pointer to "struct tomoyo_acl_param".*@ptr: Pointer to "struct tomoyo_number_union".* Returns true on success, false otherwise.
tomoyo_write_groupmoyo_write_group - Write "struct tomoyo_path_group"/"struct tomoyo_number_group"/"struct tomoyo_address_group" list.*@param: Pointer to "struct tomoyo_acl_param".*@type: Type of this group.* Returns 0 on success, negative value otherwise.