diff options
author | John Johansen <john.johansen@canonical.com> | 2016-04-12 01:55:10 +0200 |
---|---|---|
committer | John Johansen <john.johansen@canonical.com> | 2016-07-12 17:43:10 +0200 |
commit | dcda617a0c5160c73e0aa02813c871339ea08004 (patch) | |
tree | 6bea67854d3f63fea51e4199d5f87a2c2d31a2a6 | |
parent | Merge tag 'keys-misc-20160708' of git://git.kernel.org/pub/scm/linux/kernel/g... (diff) | |
download | linux-dcda617a0c5160c73e0aa02813c871339ea08004.tar.xz linux-dcda617a0c5160c73e0aa02813c871339ea08004.zip |
apparmor: fix refcount bug in profile replacement
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Seth Arnold <seth.arnold@canonical.com>
-rw-r--r-- | security/apparmor/policy.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/security/apparmor/policy.c b/security/apparmor/policy.c index 705c2879d3a9..222052f64e2c 100644 --- a/security/apparmor/policy.c +++ b/security/apparmor/policy.c @@ -1189,12 +1189,12 @@ ssize_t aa_replace_profiles(void *udata, size_t size, bool noreplace) aa_get_profile(newest); aa_put_profile(parent); rcu_assign_pointer(ent->new->parent, newest); - } else - aa_put_profile(newest); + } /* aafs interface uses replacedby */ rcu_assign_pointer(ent->new->replacedby->profile, aa_get_profile(ent->new)); __list_add_profile(&parent->base.profiles, ent->new); + aa_put_profile(newest); } else { /* aafs interface uses replacedby */ rcu_assign_pointer(ent->new->replacedby->profile, |