Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:aa_remove_profiles - remove profile(s) from the system*@policy_ns: namespace the remove is being done from*@subj: label attempting to remove policy*@fqname: name of the profile or namespace to remove (NOT NULL)*@size: size of the name* Remove a profile or

Proto:ssize_t aa_remove_profiles(struct aa_ns *policy_ns, struct aa_label *subj, char *fqname, size_t size)

Type:ssize_t

Parameter:

TypeParameterName
struct aa_ns *policy_ns
struct aa_label *subj
char *fqname
size_tsize
1097  struct aa_ns * ns = NULL
1098  struct aa_profile * profile = NULL
1099  const char * name = fqname, * info = NULL
1100  const char * ns_name = NULL
1101  error = 0
1103  If fqname == 0 Then
1104  info = "no profile specified"
1105  error = -ENOENT
1106  Go to fail
1109  If fqname[0] == ':' Then
1112  name = aa_splitn_fqname(fqname, size, & ns_name, & ns_len)
1114  ns = aa_lookupn_ns - look up a policy namespace relative to @view*@view: namespace to search in (NOT NULL)*@name: name of namespace to find (NOT NULL)*@n: length of @name* Returns: a refcounted namespace on the list, or NULL if no namespace
1116  If Not ns Then
1117  info = "namespace does not exist"
1118  error = -ENOENT
1119  Go to fail
1121  Else ns = aa_get_ns - increment references count on @ns*@ns: namespace to increment reference count of (MAYBE NULL)* Returns: pointer to @ns, if @ns is NULL returns NULL* Requires: @ns must be held with valid refcount when called
1125  If Not name Then
1127  mutex_lock_nested( & lock, level)
1128  __aa_bump_ns_revision(ns)
1129  __aa_remove_ns - remove a namespace and all its children*@ns: namespace to be removed (NOT NULL)* Requires: ns->parent->lock be held and ns removed from parent.
1130  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
1131  Else
1133  mutex_lock_nested( & lock, level)
1134  profile = 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
1135  If Not profile Then
1136  error = -ENOENT
1137  info = "profile does not exist"
1138  Go to fail_ns_lock
1140  name = hname
1141  __aa_bump_ns_revision(ns)
1142  __remove_profile - remove old profile, and children*@profile: profile to be replaced (NOT NULL)* Requires: namespace list lock be held, or list not be shared
1143  __aa_labelset_update_subtree(ns)
1144  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
1148  audit_policy - Do auditing of policy changes*@label: label to check if it can manage policy*@op: policy operation being performed*@ns_name: name of namespace being manipulated*@name: name of profile being manipulated (NOT NULL)*@info: any extra
1150  aa_put_ns - decrement refcount on @ns*@ns: namespace to put reference of* Decrement reference count of @ns and if no longer in use free it
1151  aa_put_profile - decrement refcount on profile @p*@p: profile (MAYBE NULL)
1152  Return size
1154  fail_ns_lock :
1155  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
1156  aa_put_ns - decrement refcount on @ns*@ns: namespace to put reference of* Decrement reference count of @ns and if no longer in use free it
1158  fail :
1159  audit_policy - Do auditing of policy changes*@label: label to check if it can manage policy*@op: policy operation being performed*@ns_name: name of namespace being manipulated*@name: name of profile being manipulated (NOT NULL)*@info: any extra
1161  Return error
Caller
NameDescribe
profile_remove.remove file hook fn to remove loaded policy