hc
2023-12-06 08f87f769b595151be1afeff53e144f543faa614
kernel/security/apparmor/task.c
....@@ -1,14 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * AppArmor security module
34 *
45 * This file contains AppArmor task related definitions and mediation
56 *
67 * 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.
128 *
139 * TODO
1410 * If a task uses change_hat it currently does not return to the old
....@@ -81,7 +77,7 @@
8177 */
8278 aa_get_label(label);
8379 aa_put_label(cred_label(new));
84
- cred_label(new) = label;
80
+ set_cred_label(new, label);
8581
8682 commit_creds(new);
8783 return 0;
....@@ -138,7 +134,7 @@
138134 return -EACCES;
139135 }
140136
141
- cred_label(new) = aa_get_newest_label(label);
137
+ set_cred_label(new, aa_get_newest_label(label));
142138 /* clear exec on switching context */
143139 aa_put_label(ctx->onexec);
144140 ctx->onexec = NULL;
....@@ -172,7 +168,7 @@
172168 return -ENOMEM;
173169
174170 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));
176172 AA_BUG(!cred_label(new));
177173 /* clear exec && prev information when restoring to previous context */
178174 aa_clear_task_ctx_trans(ctx);