Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name: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.

Proto:static struct aa_ns *alloc_ns(const char *prefix, const char *name)

Type:struct aa_ns

Parameter:

TypeParameterName
const char *prefix
const char *name
91  ns = kzalloc - allocate memory. The memory is set to zero.*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc).
92  AA_DEBUG("%s(%p)\n", __func__, ns)
93  If Not ns Then Return NULL
95  If Not aa_policy_init - initialize a policy structure*@policy: policy to initialize (NOT NULL)*@prefix: prefix name if any is required Then Go to fail_ns
98  Initialization list head
99  Initialization list head
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  If Not unconfined Then Go to 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  Return 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  Return NULL
Caller
NameDescribe
__aa_create_ns
aa_alloc_root_nsaa_alloc_root_ns - allocate the root profile namespace* Returns: %0 on success else error