Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/jmorris/linux-security

Pull apparmor fixes from James Morris:
 "A couple more regressions fixed"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security:
  apparmor: fix bad lock balance when introspecting policy
  apparmor: fix memleak of the profile hash
  • Loading branch information
Linus Torvalds committed Oct 17, 2013
2 parents 056cdce + ed2c7da commit b2118ea
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 1 addition & 3 deletions security/apparmor/apparmorfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -580,15 +580,13 @@ static struct aa_namespace *__next_namespace(struct aa_namespace *root,

/* check if the next ns is a sibling, parent, gp, .. */
parent = ns->parent;
while (parent) {
while (ns != root) {
mutex_unlock(&ns->lock);
next = list_entry_next(ns, base.list);
if (!list_entry_is_head(next, &parent->sub_ns, base.list)) {
mutex_lock(&next->lock);
return next;
}
if (parent == root)
return NULL;
ns = parent;
parent = parent->parent;
}
Expand Down
1 change: 1 addition & 0 deletions security/apparmor/policy.c
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,7 @@ void aa_free_profile(struct aa_profile *profile)
aa_put_dfa(profile->policy.dfa);
aa_put_replacedby(profile->replacedby);

kzfree(profile->hash);
kzfree(profile);
}

Expand Down

0 comments on commit b2118ea

Please sign in to comment.