函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:__label_insert - attempt to insert @l into a label set*@ls: set of labels to insert @l into (NOT NULL)*@label: new label to insert (NOT NULL)*@replace: whether insertion should replace existing entry that is not stale* Requires: @ls->lock* caller to hold

函数原型:static struct aa_label *__label_insert(struct aa_labelset *ls, struct aa_label *label, bool replace)

返回类型:struct aa_label

参数:

类型参数名称
struct aa_labelset *ls
struct aa_label *label
boolreplace
638  struct rb_node * * new, * parent = NULL
640  AA_BUG(!ls)
641  AA_BUG(!label)
642  AA_BUG(labels_set(label) != ls)
643  lockdep_assert_held_write( & lock)
644  AA_BUG(flags & label is in tree )
647  new等于rb_node
648 new循环
649  this等于rb_entry( * new, structaa_label, node)
650  result等于label_cmp - label comparison for set ordering*@a: label to compare (NOT NULL)*@b: label to compare (NOT NULL)* Returns: <0 if a < b* ==0 if a == b* >0 if a > b
652  parent等于new
653  如果result恒等于0则
659  如果非replace且非label_is_stale(this)则
662  否则__proxy_share(this, label)
665  返回:aa_get_label(label)
666  否则如果result小于0则new等于rb_left的地址
668  否则new等于rb_right的地址
673  rb_link_node( & node, parent, new)
674  rb_insert_color( & node, & root)
675  flags或等于 label is in tree
677  返回:aa_get_label(label)
调用者
名称描述
aa_label_replaceaa_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
vec_create_and_insert_labelquires sort and merge done first
aa_label_insertaa_label_insert - insert label @label into @ls or return existing label*@ls - labelset to insert @label into*@label - label to insert* Requires: caller to hold a valid ref on @label* Returns: ref counted @label if successful in inserting @label* else ref
label_merge_insertlabel_merge_insert - create a new label by merging @a and @b*@new: preallocated label to merge into (NOT NULL)*@a: label to merge with @b (NOT NULL)*@b: label to merge with @a (NOT NULL)* Requires: preallocated proxy* Returns: ref counted label either
__label_update__label_update - insert updated version of @label into labelset*@label - the label to update/replace* Returns: new label that is up to date* else NULL on failure* Requires: @ns lock be held* Note: worst case is the stale @label does not get updated and has