diff options
author | Eric Paris <eparis@redhat.com> | 2013-11-22 18:57:08 -0500 |
---|---|---|
committer | Eric Paris <eparis@redhat.com> | 2013-11-22 18:57:54 -0500 |
commit | fc582aef7dcc27a7120cf232c1e76c569c7b6eab (patch) | |
tree | 7d275dd4ceab6067b91e9a25a5f6338b425fbccd /security/apparmor/context.c | |
parent | 9175c9d2aed528800175ef81c90569d00d23f9be (diff) | |
parent | 5e01dc7b26d9f24f39abace5da98ccbd6a5ceb52 (diff) | |
download | op-kernel-dev-fc582aef7dcc27a7120cf232c1e76c569c7b6eab.zip op-kernel-dev-fc582aef7dcc27a7120cf232c1e76c569c7b6eab.tar.gz |
Merge tag 'v3.12'
Linux 3.12
Conflicts:
fs/exec.c
Diffstat (limited to 'security/apparmor/context.c')
-rw-r--r-- | security/apparmor/context.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/security/apparmor/context.c b/security/apparmor/context.c index d5af1d1..3064c6c 100644 --- a/security/apparmor/context.c +++ b/security/apparmor/context.c @@ -112,9 +112,9 @@ int aa_replace_current_profile(struct aa_profile *profile) aa_clear_task_cxt_trans(cxt); /* be careful switching cxt->profile, when racing replacement it - * is possible that cxt->profile->replacedby is the reference keeping - * @profile valid, so make sure to get its reference before dropping - * the reference on cxt->profile */ + * is possible that cxt->profile->replacedby->profile is the reference + * keeping @profile valid, so make sure to get its reference before + * dropping the reference on cxt->profile */ aa_get_profile(profile); aa_put_profile(cxt->profile); cxt->profile = profile; @@ -175,7 +175,7 @@ int aa_set_current_hat(struct aa_profile *profile, u64 token) abort_creds(new); return -EACCES; } - cxt->profile = aa_get_profile(aa_newest_version(profile)); + cxt->profile = aa_get_newest_profile(profile); /* clear exec on switching context */ aa_put_profile(cxt->onexec); cxt->onexec = NULL; @@ -212,14 +212,8 @@ int aa_restore_previous_profile(u64 token) } aa_put_profile(cxt->profile); - cxt->profile = aa_newest_version(cxt->previous); + cxt->profile = aa_get_newest_profile(cxt->previous); BUG_ON(!cxt->profile); - if (unlikely(cxt->profile != cxt->previous)) { - aa_get_profile(cxt->profile); - aa_put_profile(cxt->previous); - } - /* ref has been transfered so avoid putting ref in clear_task_cxt */ - cxt->previous = NULL; /* clear exec && prev information when restoring to previous context */ aa_clear_task_cxt_trans(cxt); |