Function report |
Source Code:security\apparmor\policy.c |
Create Date:2022-07-28 19:52:02 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:aa_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
Proto:ssize_t aa_replace_profiles(struct aa_ns *policy_ns, struct aa_label *label, unsigned int mask, struct aa_loaddata *udata)
Type:ssize_t
Parameter:
| Type | Parameter | Name |
|---|---|---|
| struct aa_ns * | policy_ns | |
| struct aa_label * | label | |
| unsigned int | mask | |
| struct aa_loaddata * | udata |
| 867 | op = If mask & AA_MAY_REPLACE_POLICY Then OP_PROF_REPL Else OP_PROF_LOAD |
| 879 | count = 0 |
| 881 | If ns_name Then |
| 888 | Else if ns_name Then |
| 889 | If count Then |
| 895 | Else count++ |
| 898 | If ns_name Then |
| 912 | mutex_lock_nested( & lock, level) |
| 915 | If aa_rawdata_eq(rawdata_ent, udata) Then |
| 920 | If tmp Then |
| 921 | aa_put_loaddata(udata) |
| 923 | Break |
| 938 | If rename Then |
| 954 | If Not policy Then |
| 956 | p = __list_lookup_parent( & lh, new) |
| 957 | If Not p Then |
| 971 | If Not dents[AAFS_LOADDATA_DIR] Then |
| 972 | error = __aa_fs_create_rawdata(ns, udata) |
| 973 | If error Then |
| 974 | info = "failed to create raw_data dir and files" |
| 975 | ent = NULL |
| 976 | Go to fail_lock |
| 980 | If Not old Then |
| 991 | If error Then |
| 998 | __aa_bump_ns_revision(ns) |
| 1002 | op = If Not old && Not rename Then OP_PROF_LOAD Else OP_PROF_REPL |
| 1022 | If old Then |
| 1023 | share_name(old, new) |
| 1025 | Else |
| 1037 | skip : |
| 1038 | aa_load_ent_free(ent) |
| 1043 | out : |
| 1045 | aa_put_loaddata(udata) |
| 1050 | Return he original size of the payload |
| 1052 | fail_lock : |
| 1056 | op = If ent && Not old Then OP_PROF_LOAD Else OP_PROF_REPL |
| 1057 | fail : |
| 1061 | info = "valid profile in failed atomic policy load" |
| 1064 | info = "unchecked profile in failed atomic policy load" |
| 1066 | Continue |
| 1068 | op = If Not old Then OP_PROF_LOAD Else OP_PROF_REPL |
| 1074 | aa_load_ent_free(ent) |
| 1077 | Go to out |
| Name | Describe |
|---|---|
| policy_update |
| Source code conversion tool public plug-in interface | X |
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |