函数逻辑报告 |
Source Code:security\apparmor\policy_unpack.c |
Create Date:2022-07-27 21:35:31 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| 首页 | 函数Tree |
| 注解内核,赢得工具 | 下载SCCT | English |
函数名称:pack_profile - unpack a serialized profile*@e: serialized data extent information (NOT NULL)* NOTE: unpack profile sets audit struct if there is a failure
函数原型:static struct aa_profile *unpack_profile(struct aa_ext *e, char **ns_name)
返回类型:struct aa_profile
参数:
| 类型 | 参数 | 名称 |
|---|---|---|
| struct aa_ext * | e | |
| char ** | ns_name |
| 676 | struct aa_profile * profile = NULL |
| 678 | info等于"failed to unpack profile" |
| 680 | struct rhashtable_params params = {0} |
| 681 | char * key = NULL |
| 687 | * ns_name = NULL |
| 692 | 如果非unpack_str(e, & name, NULL)则转到:fail |
| 697 | tmpname等于aa_splitn_fqname(name, strlen - Find the length of a string*@s: The string to be sized, & tmpns, & ns_len) |
| 698 | 如果tmpns则 |
| 700 | 如果非ns_name则 |
| 707 | profile等于aa_alloc_profile - allocate, initialize and return a new profile*@hname: name of the profile (NOT NULL)*@gfp: allocation type* Returns: refcount profile or NULL on failure |
| 712 | unpack_str(e, & rename, "rename") |
| 715 | unpack_str(e, & attach, "attach") |
| 718 | xmatch等于pack_dfa - unpack a file rule dfa*@e: serialized data extent information (NOT NULL)* returns dfa or ERR_PTR or NULL if no dfa |
| 719 | 如果是错误则 |
| 726 | 如果xmatch则 |
| 735 | unpack_str(e, & disconnected, "disconnected") |
| 742 | info等于"failed to unpack profile flags" |
| 743 | 如果非unpack_u32(e, & tmp, NULL)则转到:fail |
| 745 | 如果tmp按位与PACKED_FLAG_HAT则flags或等于 profile is a hat |
| 747 | 如果非unpack_u32(e, & tmp, NULL)则转到:fail |
| 749 | 如果tmp恒等于PACKED_MODE_COMPLAIN或version按位与FORCE_COMPLAIN_FLAG则mode等于allow and log access violations |
| 751 | 否则如果tmp恒等于PACKED_MODE_KILL则mode等于kill task on access violation |
| 753 | 否则如果tmp恒等于PACKED_MODE_UNCONFINED则mode等于profile set to unconfined |
| 755 | 如果非unpack_u32(e, & tmp, NULL)则转到:fail |
| 764 | 如果unpack_u32(e, & path_flags, "path_flags")则path_flags或等于flags按位与 mediate deleted paths |
| 767 | 否则path_flags等于 mediate deleted paths |
| 771 | info等于"failed to unpack profile capabilities" |
| 772 | 如果非unpack_u32(e, & (cap[0]), NULL)则转到:fail |
| 774 | 如果非unpack_u32(e, & (cap[0]), NULL)则转到:fail |
| 776 | 如果非unpack_u32(e, & (cap[0]), NULL)则转到:fail |
| 778 | 如果非unpack_u32(e, & cap[0], NULL)则转到:fail |
| 781 | info等于"failed to unpack upper profile capabilities" |
| 784 | 如果非unpack_u32(e, & (cap[1]), NULL)则转到:fail |
| 786 | 如果非unpack_u32(e, & (cap[1]), NULL)则转到:fail |
| 788 | 如果非unpack_u32(e, & (cap[1]), NULL)则转到:fail |
| 790 | 如果非unpack_u32(e, & (cap[1]), NULL)则转到:fail |
| 796 | info等于"failed to unpack extended profile capabilities" |
| 799 | 如果非unpack_u32(e, & (cap[0]), NULL)则转到:fail |
| 801 | 如果非unpack_u32(e, & (cap[1]), NULL)则转到:fail |
| 807 | 如果非unpack_xattrs(e, profile)则 |
| 812 | 如果非unpack_rlimits(e, profile)则 |
| 817 | 如果非unpack_secmark(e, profile)则 |
| 824 | info等于"failed to unpack policydb" |
| 825 | Generic policy DFA specific rule types will be subsections of it 等于pack_dfa - unpack a file rule dfa*@e: serialized data extent information (NOT NULL)* returns dfa or ERR_PTR or NULL if no dfa |
| 826 | 如果是错误则 |
| 829 | 转到:fail |
| 834 | 如果非unpack_u32(e, & set of start states for the different classes of data[0], "start")则 set of start states for the different classes of data[0]等于DFA_START |
| 838 | 以i小于等于AA_CLASS_LAST循环 |
| 850 | dfa等于pack_dfa - unpack a file rule dfa*@e: serialized data extent information (NOT NULL)* returns dfa or ERR_PTR or NULL if no dfa |
| 851 | 如果是错误则 |
| 856 | 否则如果dfa则 |
| 857 | 如果非unpack_u32(e, & start, "dfa_start")则start等于DFA_START |
| 864 | 否则dfa等于aa_get_dfa - increment refcount on dfa @p*@dfa: dfa (MAYBE NULL)* Returns: pointer to @dfa if @dfa is NULL will return NULL* Requires: @dfa must be held with valid refcount when called |
| 873 | info等于"out of memory" |
| 878 | nelem_hint等于3 |
| 879 | key_len等于*的长度 |
| 880 | key_offset等于offsetof(structaa_data, key) |
| 881 | head_offset等于offsetof(structaa_data, head) |
| 890 | 当unpack_strdup(e, & key, NULL)循环 |
| 892 | 如果非data则 |
| 894 | 转到:fail |
| 898 | size of data in bytes等于unpack_blob(e, & binary data, NULL) |
| 900 | 如果 size of data in bytes且非 binary data则 |
| 903 | 转到:fail |
| 921 | 返回:profile |
| 923 | fail : |
| 931 | 返回:错误号 |
| 名称 | 描述 |
|---|---|
| aa_unpack | 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 |
| 源代码转换工具 开放的插件接口 | X |
|---|---|
| 支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |