函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:alloc_ns - allocate, initialize and return a new namespace*@prefix: parent namespace name (MAYBE NULL)*@name: a preallocated name (NOT NULL)* Returns: refcounted namespace or NULL on failure.

函数原型:static struct aa_ns *alloc_ns(const char *prefix, const char *name)

返回类型:struct aa_ns

参数:

类型参数名称
const char *prefix
const char *name
91  ns等于分配内存并置零
92  AA_DEBUG("%s(%p)\n", __func__, ns)
93  如果非ns则返回:NULL
95  如果非aa_policy_init - initialize a policy structure*@policy: policy to initialize (NOT NULL)*@prefix: prefix name if any is required则转到:fail_ns
98  初始化链表头
99  初始化链表头
100  mutex_init - initialize the mutex*@mutex: the mutex to be initialized* Initialize the mutex to unlocked state.* It is not allowed to initialize an already locked mutex.( & lock)
101  init_waitqueue_head( & wait)
104  unconfined等于aa_alloc_profile - allocate, initialize and return a new profile*@hname: name of the profile (NOT NULL)*@gfp: allocation type* Returns: refcount profile or NULL on failure
105  如果非unconfined则转到:fail_unconfined
108  flags或等于 fallback to ix on name lookup fail 按位或 don't allow changes/replacement 按位或 carries NS ref count 按位或 label unconfined only if all
110  mode等于profile set to unconfined
111  dfa等于aa_get_dfa - increment refcount on dfa @p*@dfa: dfa (MAYBE NULL)* Returns: pointer to @dfa if @dfa is NULL will return NULL* Requires: @dfa must be held with valid refcount when called
112  Generic policy DFA specific rule types will be subsections of it 等于aa_get_dfa - increment refcount on dfa @p*@dfa: dfa (MAYBE NULL)* Returns: pointer to @dfa if @dfa is NULL will return NULL* Requires: @dfa must be held with valid refcount when called
115  ns等于ns
117  atomic_set( & uniq_null, 0)
119  aa_labelset_init( & labels)
121  返回:ns
123  fail_unconfined :
124  kzfree - like kfree but zero memory*@p: object to free memory of* The memory of the object @p points to is zeroed before freed.* If @p is %NULL, kzfree() does nothing.* Note: this function zeroes the whole allocated buffer which can be a good
125  fail_ns :
126  kzfree - like kfree but zero memory*@p: object to free memory of* The memory of the object @p points to is zeroed before freed.* If @p is %NULL, kzfree() does nothing.* Note: this function zeroes the whole allocated buffer which can be a good
127  返回:NULL
调用者
名称描述
__aa_create_ns
aa_alloc_root_nsaa_alloc_root_ns - allocate the root profile namespace* Returns: %0 on success else error