Commit b2118ea97113de62ca5e19c1d92cf9c2966c45e8
Exists in
smarc-imx_3.14.28_1.0.0_ga
and in
1 other branch
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
Showing 2 changed files Side-by-side Diff
security/apparmor/apparmorfs.c
... | ... | @@ -580,15 +580,13 @@ |
580 | 580 | |
581 | 581 | /* check if the next ns is a sibling, parent, gp, .. */ |
582 | 582 | parent = ns->parent; |
583 | - while (parent) { | |
583 | + while (ns != root) { | |
584 | 584 | mutex_unlock(&ns->lock); |
585 | 585 | next = list_entry_next(ns, base.list); |
586 | 586 | if (!list_entry_is_head(next, &parent->sub_ns, base.list)) { |
587 | 587 | mutex_lock(&next->lock); |
588 | 588 | return next; |
589 | 589 | } |
590 | - if (parent == root) | |
591 | - return NULL; | |
592 | 590 | ns = parent; |
593 | 591 | parent = parent->parent; |
594 | 592 | } |