Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

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

Proto:static struct aa_label *__label_insert(struct aa_labelset *ls, struct aa_label *label, bool replace)

Type:struct aa_label

Parameter:

TypeParameterName
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  When new cycle
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  If result == 0 Then
659  If Not replace && Not label_is_stale(this) Then
662  Else __proxy_share(this, label)
665  Return aa_get_label(label)
666  Else if result < 0 Then new = &rb_left
668  Else new = &rb_right
673  rb_link_node( & node, parent, new)
674  rb_insert_color( & node, & root)
675  flags |= label is in tree
677  Return aa_get_label(label)
Caller
NameDescribe
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