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

Proto:static struct aa_label *label_merge_insert(struct aa_label *new, struct aa_label *a, struct aa_label *b)

Type:struct aa_label

Parameter:

TypeParameterName
struct aa_label *new
struct aa_label *a
struct aa_label *b
1028  k = 0 , invcount = 0
1029  bool stale = false
1031  AA_BUG(!a)
1032  AA_BUG(size < 0)
1033  AA_BUG(!b)
1034  AA_BUG(size < 0)
1035  AA_BUG(!new)
1036  AA_BUG(size < size + size)
1039  AA_BUG(!next)
1040  If profile_is_stale(next) Then
1041  vec[k] = 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
1042  AA_BUG(!proxy)
1043  AA_BUG(!label)
1044  If proxy != proxy Then invcount++
1046  k++
1047  stale = true
1048  Else vec[k++] = 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
1052  size = k
1053  vec[k] = NULL
1055  If invcount Then
1056  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
1059  If size == 1 Then
1060  label = aa_get_label( & label)
1061  Return label
1063  Else if Not stale Then
1068  If k == size Then Return aa_get_label(a)
1070  Else if k == size Then Return aa_get_label(b)
1073  If vec_unconfined(vec, size) Then flags |= label unconfined only if all
1075  ls = labels_set(new)
1076  write_lock_irqsave( & lock, flags)
1077  label = __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
1078  write_unlock_irqrestore( & lock, flags)
1080  Return label
Caller
NameDescribe
aa_label_mergeaa_label_merge - attempt to insert new merged label of @a and @b*@ls: set of labels to insert label into (NOT NULL)*@a: label to merge with @b (NOT NULL)*@b: label to merge with @a (NOT NULL)*@gfp: memory allocation type* Requires: caller to hold valid