diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-10-17 13:16:45 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-10-17 13:16:45 -0400 |
| commit | b2118ea97113de62ca5e19c1d92cf9c2966c45e8 (patch) | |
| tree | 8d71a2f8b0656481ef00c6087536dde6bd261e1e | |
| parent | 056cdce0d3a214158f3a4ea40887b22639f855a8 (diff) | |
| parent | ed2c7da3a40c58410508fe24e12d03e508d7ec01 (diff) | |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/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
| -rw-r--r-- | security/apparmor/apparmorfs.c | 4 | ||||
| -rw-r--r-- | security/apparmor/policy.c | 1 |
2 files changed, 2 insertions, 3 deletions
diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c index 95c2b2689a03..7db9954f1af2 100644 --- a/security/apparmor/apparmorfs.c +++ b/security/apparmor/apparmorfs.c | |||
| @@ -580,15 +580,13 @@ static struct aa_namespace *__next_namespace(struct aa_namespace *root, | |||
| 580 | 580 | ||
| 581 | /* check if the next ns is a sibling, parent, gp, .. */ | 581 | /* check if the next ns is a sibling, parent, gp, .. */ |
| 582 | parent = ns->parent; | 582 | parent = ns->parent; |
| 583 | while (parent) { | 583 | while (ns != root) { |
| 584 | mutex_unlock(&ns->lock); | 584 | mutex_unlock(&ns->lock); |
| 585 | next = list_entry_next(ns, base.list); | 585 | next = list_entry_next(ns, base.list); |
| 586 | if (!list_entry_is_head(next, &parent->sub_ns, base.list)) { | 586 | if (!list_entry_is_head(next, &parent->sub_ns, base.list)) { |
| 587 | mutex_lock(&next->lock); | 587 | mutex_lock(&next->lock); |
| 588 | return next; | 588 | return next; |
| 589 | } | 589 | } |
| 590 | if (parent == root) | ||
| 591 | return NULL; | ||
| 592 | ns = parent; | 590 | ns = parent; |
| 593 | parent = parent->parent; | 591 | parent = parent->parent; |
| 594 | } | 592 | } |
diff --git a/security/apparmor/policy.c b/security/apparmor/policy.c index 345bec07a27d..705c2879d3a9 100644 --- a/security/apparmor/policy.c +++ b/security/apparmor/policy.c | |||
| @@ -610,6 +610,7 @@ void aa_free_profile(struct aa_profile *profile) | |||
| 610 | aa_put_dfa(profile->policy.dfa); | 610 | aa_put_dfa(profile->policy.dfa); |
| 611 | aa_put_replacedby(profile->replacedby); | 611 | aa_put_replacedby(profile->replacedby); |
| 612 | 612 | ||
| 613 | kzfree(profile->hash); | ||
| 613 | kzfree(profile); | 614 | kzfree(profile); |
| 614 | } | 615 | } |
| 615 | 616 | ||
