Function report |
Source Code:security\apparmor\domain.c |
Create Date:2022-07-28 19:51:39 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:aa_change_profile - perform a one-way profile transition*@fqname: name of profile may include namespace (NOT NULL)*@onexec: whether this transition is to take place immediately or at exec*@flags: flags affecting change behavior
Proto:int aa_change_profile(const char *fqname, int flags)
Type:int
Parameter:
| Type | Parameter | Name |
|---|---|---|
| const char * | fqname | |
| int | flags |
| 1310 | const char * info = NULL |
| 1312 | stack = flags & AA_CHANGE_STACK |
| 1313 | ctx = task_ctx(current process) |
| 1314 | error = 0 |
| 1327 | If task_no_new_privs(current process) && Not unconfined(label) && Not nnp Then nnp = aa_get_label(label) |
| 1335 | If flags & AA_CHANGE_ONEXEC Then |
| 1337 | If stack Then op = OP_STACK_ONEXEC |
| 1339 | Else op = OP_CHANGE_ONEXEC |
| 1341 | Else |
| 1342 | request = AA_MAY_CHANGE_PROFILE |
| 1345 | Else op = OP_CHANGE_PROFILE |
| 1351 | If fqname == '&' Then |
| 1356 | target = aa_label_parse(label, fqname, GFP_KERNEL, true, false) |
| 1360 | info = "label not found" |
| 1362 | target = NULL |
| 1367 | If flags & AA_CHANGE_TEST || Not COMPLAIN_MODE(labels_profile(label)) Then Go to audit |
| 1373 | If Not tprofile Then |
| 1379 | Go to check |
| 1390 | error = fn_for_each_in_ns(label, profile, change_profile_perms_wrapper(op, auditname, profile, target, stack, request, & perms)) |
| 1400 | check : |
| 1403 | If error && Not fn_for_each_in_ns(label, profile, COMPLAIN_MODE(profile)) Then Go to audit |
| 1414 | If flags & AA_CHANGE_TEST Then Go to out |
| 1418 | If Not stack Then |
| 1419 | new = fn_label_build_in_ns(label, profile, GFP_KERNEL, aa_get_label(target), aa_get_label( & label)) |
| 1426 | If task_no_new_privs(current process) && Not unconfined(label) && Not aa_label_is_subset(new, nnp) Then |
| 1435 | If Not (flags & AA_CHANGE_ONEXEC) Then |
| 1439 | If IS_ERR_OR_NULL(new) Then |
| 1450 | Else |
| 1451 | If new Then |
| 1452 | aa_put_label(new) |
| 1453 | new = NULL |
| 1460 | audit : |
| 1466 | out : |
| 1467 | aa_put_label(new) |
| 1468 | aa_put_label(target) |
| 1469 | aa_put_label(label) |
| 1471 | Return error |
| Name | Describe |
|---|---|
| apparmor_setprocattr |
| 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 |