Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:aa_unpack - unpack packed binary profile(s) data loaded from user space*@udata: user data copied to kmem (NOT NULL)*@lh: list to place unpacked profiles in a aa_repl_ws*@ns: Returns namespace profile is in if specified else NULL (NOT NULL)* Unpack user

Proto:int aa_unpack(struct aa_loaddata *udata, struct list_head *lh, const char **ns)

Type:int

Parameter:

TypeParameterName
struct aa_loaddata *udata
struct list_head *lh
const char **ns
1163  struct aa_profile * profile = NULL
1165  struct aa_ext e = {start = Pointer to payload. If @compressed_size > 0, then this is the* compressed version of the payload, else it is the uncompressed* version (with the size indicated by @size)., end = Pointer to payload. If @compressed_size > 0, then this is the* compressed version of the payload, else it is the uncompressed* version (with the size indicated by @size). + he original size of the payload , pointer to current position in the buffer = Pointer to payload. If @compressed_size > 0, then this is the* compressed version of the payload, else it is the uncompressed* version (with the size indicated by @size)., }
1171  * ns = NULL
1172  When pointer to current position in the buffer < end cycle
1173  char * ns_name = NULL
1175  error = verify_head - unpack serialized stream header*@e: serialized data read head (NOT NULL)*@required: whether the header is required or optional*@ns: Returns - namespace if one is specified else NULL (NOT NULL)* Returns: error or 0 if header is good
1176  If error Then Go to fail
1179  start = pointer to current position in the buffer
1180  profile = pack_profile - unpack a serialized profile*@e: serialized data extent information (NOT NULL)* NOTE: unpack profile sets audit struct if there is a failure
1181  If IS_ERR(profile) Then
1182  error = PTR_ERR(profile)
1183  Go to fail
1186  error = verify_profile - Do post unpack analysis to verify profile consistency*@profile: profile to verify (NOT NULL)* Returns: 0 if passes verification else error
1187  If error Then Go to fail_profile
1190  If aa_g_hash_policy Then error = aa_calc_profile_hash(profile, version, start, pointer to current position in the buffer - start)
1193  If error Then Go to fail_profile
1196  ent = aa_load_ent_alloc()
1197  If Not ent Then
1198  error = -ENOMEM
1199  Go to fail_profile
1202  new = profile
1203  ns_name = ns_name
1204  list_add_tail - add a new entry*@new: new entry to be added*@head: list head to add it before* Insert a new entry before the specified head.* This is useful for implementing queues.
1206  abi = version & K_ABI_MASK
1207  If aa_g_hash_policy Then
1208  hash = aa_calc_hash(Pointer to payload. If @compressed_size > 0, then this is the* compressed version of the payload, else it is the uncompressed* version (with the size indicated by @size)., he original size of the payload )
1209  If IS_ERR(hash) Then
1210  error = PTR_ERR(hash)
1211  hash = NULL
1212  Go to fail
1215  error = compress_loaddata(udata)
1216  If error Then Go to fail
1218  Return 0
1220  fail_profile :
1221  aa_put_profile - decrement refcount on profile @p*@p: profile (MAYBE NULL)
1223  fail :
1225  list_del_init - deletes entry from list and reinitialize it.*@entry: the element to delete from the list.
1226  aa_load_ent_free(ent)
1229  Return error
Caller
NameDescribe
aa_replace_profilesaa_replace_profiles - replace profile(s) on the profile list*@policy_ns: namespace load is occurring on*@label: label that is attempting to load/replace policy*@mask: permission mask*@udata: serialized data stream (NOT NULL)* unpack and replace a profile