函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\apparmor\policy_unpack.c Create Date:2022-07-27 21:36:00
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称: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

函数原型:int aa_unpack(struct aa_loaddata *udata, struct list_head *lh, const char **ns)

返回类型:int

参数:

类型参数名称
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 pointer to current position in the buffer 小于end循环
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  如果error则转到: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  如果是错误
1182  error等于错误
1183  转到: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  如果error则转到:fail_profile
1190  如果aa_g_hash_policyerror等于aa_calc_profile_hash(profile, version, start, pointer to current position in the buffer - start)
1193  如果error则转到:fail_profile
1196  ent等于aa_load_ent_alloc()
1197  如果非ent
1198  error等于负ENOMEM
1199  转到:fail_profile
1202  new等于profile
1203  ns_name等于ns_name
1204  添加链表项
1206  abi等于version按位与K_ABI_MASK
1207  如果aa_g_hash_policy
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  如果是错误
1210  error等于错误
1211  hash = NULL
1212  转到:fail
1215  error等于compress_loaddata(udata)
1216  如果error则转到:fail
1218  返回:0
1220  fail_profile :
1221  aa_put_profile - decrement refcount on profile @p*@p: profile (MAYBE NULL)
1223  fail :
1225  删除链表项并重新初始化
1226  aa_load_ent_free(ent)
1229  返回:error
调用者
名称描述
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