summaryrefslogtreecommitdiffstats
path: root/security/apparmor/context.c
diff options
context:
space:
mode:
authorJohn Johansen <john.johansen@canonical.com>2013-02-27 03:43:40 -0800
committerJohn Johansen <john.johansen@canonical.com>2013-04-28 00:39:35 -0700
commit214beacaa7b669473bc963af719fa359a8312ea4 (patch)
treee847f9c082c579f711a53f35442710af753aaf7f /security/apparmor/context.c
parent53fe8b9961716033571d9799005bfdbbafa5162c (diff)
downloadop-kernel-dev-214beacaa7b669473bc963af719fa359a8312ea4.zip
op-kernel-dev-214beacaa7b669473bc963af719fa359a8312ea4.tar.gz
apparmor: localize getting the security context to a few macros
Signed-off-by: John Johansen <john.johansen@canonical.com> Acked-by: Seth Arnold <seth.arnold@canonical.com>
Diffstat (limited to 'security/apparmor/context.c')
-rw-r--r--security/apparmor/context.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/security/apparmor/context.c b/security/apparmor/context.c
index 3f911af..d5af1d1 100644
--- a/security/apparmor/context.c
+++ b/security/apparmor/context.c
@@ -93,7 +93,7 @@ struct aa_profile *aa_get_task_profile(struct task_struct *task)
*/
int aa_replace_current_profile(struct aa_profile *profile)
{
- struct aa_task_cxt *cxt = current_cred()->security;
+ struct aa_task_cxt *cxt = current_cxt();
struct cred *new;
BUG_ON(!profile);
@@ -104,7 +104,7 @@ int aa_replace_current_profile(struct aa_profile *profile)
if (!new)
return -ENOMEM;
- cxt = new->security;
+ cxt = cred_cxt(new);
if (unconfined(profile) || (cxt->profile->ns != profile->ns))
/* if switching to unconfined or a different profile namespace
* clear out context state
@@ -136,7 +136,7 @@ int aa_set_current_onexec(struct aa_profile *profile)
if (!new)
return -ENOMEM;
- cxt = new->security;
+ cxt = cred_cxt(new);
aa_get_profile(profile);
aa_put_profile(cxt->onexec);
cxt->onexec = profile;
@@ -163,7 +163,7 @@ int aa_set_current_hat(struct aa_profile *profile, u64 token)
return -ENOMEM;
BUG_ON(!profile);
- cxt = new->security;
+ cxt = cred_cxt(new);
if (!cxt->previous) {
/* transfer refcount */
cxt->previous = cxt->profile;
@@ -200,7 +200,7 @@ int aa_restore_previous_profile(u64 token)
if (!new)
return -ENOMEM;
- cxt = new->security;
+ cxt = cred_cxt(new);
if (cxt->token != token) {
abort_creds(new);
return -EACCES;
OpenPOWER on IntegriCloud