函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:aa_new_null_profile - create or find a null-X learning profile*@parent: profile that caused this profile to be created (NOT NULL)*@hat: true if the null- learning profile is a hat*@base: name to base the null profile off of*@gfp: type of allocation

函数原型:struct aa_profile *aa_new_null_profile(struct aa_profile *parent, bool hat, const char *base, gfp_t gfp)

返回类型:struct aa_profile

参数:

类型参数名称
struct aa_profile *parent
boolhat
const char *base
gfp_tgfp
507  char * name = NULL
509  AA_BUG(!parent)
511  如果base
512  name等于开辟内存
514  如果name
516  转到:name
521  name等于开辟内存
522  如果非name则返回:NULL
524  输出格式化串
527  name :
529  bname等于asename - find the last component of an hname*@name: hname to find the base profile name component of (NOT NULL)* Returns: the tail (base profile name) name component of an hname
530  profile等于aa_find_child - find a profile by @name in @parent*@parent: profile to search (NOT NULL)*@name: profile name to search for (NOT NULL)* Returns: a refcounted profile or NULL if not found
531  如果profile则转到:out
534  profile等于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
535  如果非profile则转到:fail
538  mode等于allow and log access violations
539  flags或等于 profile is null learning profile
540  如果hatflags或等于 profile is a hat
542  path_flags等于path_flags
545  cu_assign_pointer() - assign to RCU-protected pointer*@p: pointer to assign to*@v: value to assign (publish)* Assigns the specified value to the specified RCU-protected* pointer, ensuring that any concurrent RCU readers will see* any prior initialization(parent, aa_get_profile - increment refcount on profile @p*@p: profile (MAYBE NULL)* Returns: pointer to @p if @p is NULL will return NULL* Requires: @p must be held with valid refcount when called)
546  ns等于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
547  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
548  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
550  mutex_lock_nested( & lock, level)
551  p等于__find_child - find a profile on @head list with a name matching @name*@head: list to search (NOT NULL)*@name: name of profile (NOT NULL)* Requires: rcu_read_lock be held* Returns: unrefcounted profile ptr, or NULL if not found
552  如果p
553  aa_free_profile - free a profile*@profile: the profile to free (MAYBE NULL)* Free a profile, its hats and null_profile
554  profile等于aa_get_profile - increment refcount on profile @p*@p: profile (MAYBE NULL)* Returns: pointer to @p if @p is NULL will return NULL* Requires: @p must be held with valid refcount when called
555  否则
556  __add_profile - add a profiles to list and label tree*@list: list to add it to (NOT NULL)*@profile: the profile to add (NOT NULL)* refcount @profile, should be put by __list_remove_profile* Requires: namespace lock be held, or list not be shared
558  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.
561  out :
562  释放内存
564  返回:profile
566  fail :
567  释放内存
568  aa_free_profile - free a profile*@profile: the profile to free (MAYBE NULL)* Free a profile, its hats and null_profile
569  返回:NULL
调用者
名称描述
build_change_hathelper fn for change_hat* Returns: label for hat transition OR ERR_PTR. Does NOT return NULL
aa_change_profileaa_change_profile - perform a one-way profile transition*@fqname: name of profile may include namespace (NOT NULL)*@onexec: whether this transition is to take place immediately or at exec*@flags: flags affecting change behavior
profile_transition