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:12
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:__aa_create_ns

Proto:static struct aa_ns *__aa_create_ns(struct aa_ns *parent, const char *name, struct dentry *dir)

Type:struct aa_ns

Parameter:

TypeParameterName
struct aa_ns *parent
const char *name
struct dentry *dir
248  AA_BUG(!parent)
249  AA_BUG(!name)
250  AA_BUG(!mutex_is_locked( & lock))
252  ns = 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.
253  If Not ns Then Return ERR_PTR( - ENOMEM)
255  level = level + 1
256  mutex_lock_nested( & lock, level)
257  error = Requires: @ns->lock held
258  If error Then
259  AA_ERROR("Failed to create interface for ns %s\n", name)
261  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.
262  aa_free_ns - free a profile namespace*@ns: the namespace to free (MAYBE NULL)* Requires: All references to the namespace must have been put, if the* namespace was referenced by a profile confining a task,
263  Return ERR_PTR(error)
265  parent = aa_get_ns - increment references count on @ns*@ns: namespace to increment reference count of (MAYBE NULL)* Returns: pointer to @ns, if @ns is NULL returns NULL* Requires: @ns must be held with valid refcount when called
266  list_add_rcu - add a new entry to rcu-protected list*@new: new entry to be added*@head: list head to add it after* Insert a new entry after the specified head
268  aa_get_ns - increment references count on @ns*@ns: namespace to increment reference count of (MAYBE NULL)* Returns: pointer to @ns, if @ns is NULL returns NULL* Requires: @ns must be held with valid refcount when called
269  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.
271  Return ns
Caller
NameDescribe
__aa_find_or_create_nsaa_create_ns - create an ns, fail if it already exists*@parent: the parent of the namespace being created*@name: the name of the namespace*@dir: if not null the dir to put the ns entries in* Returns: the a refcounted ns that has been add or an ERR_PTR
aa_prepare_nsaa_prepare_ns - find an existing or create a new namespace of @name*@parent: ns to treat as parent*@name: the namespace to find or add (NOT NULL)* Returns: refcounted namespace or PTR_ERR if failed to create one