函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:__replace_profile - replace @old with @new on a list*@old: profile to be replaced (NOT NULL)*@new: profile to replace @old with (NOT NULL)*@share_proxy: transfer @old->proxy to @new* Will duplicate and refcount elements that @new inherits from @old

函数原型:static void __replace_profile(struct aa_profile *old, struct aa_profile *new)

返回类型:void

参数:

类型参数名称
struct aa_profile *old
struct aa_profile *new
744  如果非链表为空
745  LIST_HEAD(lh)
746  list_splice_init_rcu - splice an RCU-protected list into an existing list,* designed for stacks.*@list: the RCU-protected list to splice*@head: the place in the existing list to splice the first list into
751  删除链表项并重新初始化
752  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
753  如果p
756  继续下一循环
762  p等于aa_deref_parent(child)
763  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)
764  添加RCU保护项
765  aa_put_profile - decrement refcount on profile @p*@p: profile (MAYBE NULL)
769  如果非cu_access_pointer() - fetch RCU pointer with no dereferencing*@p: The pointer to read* Return the value of the specified RCU-protected pointer, but omit the* lockdep checks for being in an RCU read-side critical section(parent)则
770  parent等于aa_deref_parent(old)
771  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)
773  aa_label_replace - replace a label @old with a new version @new*@old: label to replace*@new: label replacing @old* Returns: true if @old was in tree and replaced* else @old was not in tree, and @new was not inserted
775  Requires: @old->ns->lock held
777  如果链表为空
779  更新RCU锁项
780  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
781  aa_put_profile - decrement refcount on profile @p*@p: profile (MAYBE NULL)
782  否则__list_remove_profile - remove a profile from the list it is on*@profile: the profile to remove (NOT NULL)* remove a profile from the list, warning generally removal should* be done with __replace_profile as most profile removals are
调用者
名称描述
__replace_profile__replace_profile - replace @old with @new on a list*@old: profile to be replaced (NOT NULL)*@new: profile to replace @old with (NOT NULL)*@share_proxy: transfer @old->proxy to @new* Will duplicate and refcount elements that @new inherits from @old
aa_replace_profilesaa_replace_profiles - replace profile(s) on the profile list*@policy_ns: namespace load is occurring on*@label: label that is attempting to load/replace policy*@mask: permission mask*@udata: serialized data stream (NOT NULL)* unpack and replace a profile