.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * AppArmor security module |
---|
3 | 4 | * |
---|
4 | 5 | * This file contains AppArmor task related definitions and mediation |
---|
5 | 6 | * |
---|
6 | 7 | * Copyright 2017 Canonical Ltd. |
---|
7 | | - * |
---|
8 | | - * This program is free software; you can redistribute it and/or |
---|
9 | | - * modify it under the terms of the GNU General Public License as |
---|
10 | | - * published by the Free Software Foundation, version 2 of the |
---|
11 | | - * License. |
---|
12 | 8 | * |
---|
13 | 9 | * TODO |
---|
14 | 10 | * If a task uses change_hat it currently does not return to the old |
---|
.. | .. |
---|
81 | 77 | */ |
---|
82 | 78 | aa_get_label(label); |
---|
83 | 79 | aa_put_label(cred_label(new)); |
---|
84 | | - cred_label(new) = label; |
---|
| 80 | + set_cred_label(new, label); |
---|
85 | 81 | |
---|
86 | 82 | commit_creds(new); |
---|
87 | 83 | return 0; |
---|
.. | .. |
---|
138 | 134 | return -EACCES; |
---|
139 | 135 | } |
---|
140 | 136 | |
---|
141 | | - cred_label(new) = aa_get_newest_label(label); |
---|
| 137 | + set_cred_label(new, aa_get_newest_label(label)); |
---|
142 | 138 | /* clear exec on switching context */ |
---|
143 | 139 | aa_put_label(ctx->onexec); |
---|
144 | 140 | ctx->onexec = NULL; |
---|
.. | .. |
---|
172 | 168 | return -ENOMEM; |
---|
173 | 169 | |
---|
174 | 170 | aa_put_label(cred_label(new)); |
---|
175 | | - cred_label(new) = aa_get_newest_label(ctx->previous); |
---|
| 171 | + set_cred_label(new, aa_get_newest_label(ctx->previous)); |
---|
176 | 172 | AA_BUG(!cred_label(new)); |
---|
177 | 173 | /* clear exec && prev information when restoring to previous context */ |
---|
178 | 174 | aa_clear_task_ctx_trans(ctx); |
---|