Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

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

Proto:static struct aa_label *__label_update(struct aa_label *label)

Type:struct aa_label

Parameter:

TypeParameterName
struct aa_label *label
2026  invcount = 0
2028  AA_BUG(!label)
2029  AA_BUG(!mutex_is_locked( & lock))
2031  new = aa_label_alloc - allocate a label with a profile vector of @size length*@size: size of profile vector in the label*@proxy: proxy to use OR null if to allocate a new one*@gfp: memory allocation type* Returns: new label* else NULL if failed
2032  If Not new Then Return NULL
2039  ls = labels_set(label)
2040  write_lock_irqsave( & lock, flags)
2041  When i < size cycle
2042  AA_BUG(!vec[i])
2043  vec[i] = aa_get_newest_profile - simple wrapper fn to wrap the label version*@p: profile (NOT NULL)* Returns refcount to newest version of the profile (maybe @p)* Requires: @p must be held with a valid refcount
2044  AA_BUG(!vec[i])
2045  AA_BUG(!proxy)
2046  AA_BUG(!label)
2047  If proxy != proxy Then invcount++
2052  If invcount Then
2053  size -= aa_vec_unique - canonical sort and unique a list of profiles*@n: number of refcounted profiles in the list (@n > 0)*@vec: list of profiles to sort and merge* Returns: the number of duplicates eliminated == references put* If @flags & VEC_FLAG_TERMINATE
2056  If size == 1 Then
2057  tmp = aa_get_label( & label)
2058  AA_BUG(tmp == label)
2059  Go to remove
2061  If labels_set(label) != labels_set(new) Then
2065  Go to remove
2067  Else AA_BUG(labels_ns(label) != labels_ns(new))
2070  tmp = __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
2071  remove :
2073  __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
2074  write_unlock_irqrestore( & lock, flags)
2075  label_free_or_put_new(tmp, new)
2077  Return tmp
Caller
NameDescribe
__labelset_update__labelset_update - update labels in @ns*@ns: namespace to update labels in (NOT NULL)* Requires: @ns lock be held* Walk the labelset ensuring that all labels are up to date and valid* Any label that has a stale component is marked stale and replaced and