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

Proto:bool aa_label_replace(struct aa_label *old, struct aa_label *new)

Type:bool

Parameter:

TypeParameterName
struct aa_label *old
struct aa_label *new
770  If name_is_shared(old, new) && labels_ns(old) == labels_ns(new) Then
771  write_lock_irqsave( & lock, flags)
772  If proxy != proxy Then __proxy_share(old, new)
774  Else quires profile list write lock held
776  res = __label_replace - replace @old with @new in label set*@old: label to remove from label set*@new: label to replace @old with* Requires: labels_set(@old)->lock write_lock* valid ref count be held on @new* Returns: true if @old was in set and replaced by
777  write_unlock_irqrestore( & lock, flags)
778  Else
780  ls = labels_set(old)
782  write_lock_irqsave( & lock, flags)
783  res = __label_remove - remove @label from the label set*@l: label to remove*@new: label to redirect to* Requires: labels_set(@label)->lock write_lock* Returns: true if the label was in the tree and removed
784  If labels_ns(old) != labels_ns(new) Then
786  ls = labels_set(new)
789  l = __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
790  res = l == new
791  write_unlock_irqrestore( & lock, flags)
792  aa_put_label(l)
795  Return res
Caller
NameDescribe
__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