Signed-off-by: John Johansen <[email protected]>
---
 security/apparmor/apparmorfs.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c
index 8b3875f..cf7cc47 100644
--- a/security/apparmor/apparmorfs.c
+++ b/security/apparmor/apparmorfs.c
@@ -455,16 +455,16 @@ static struct aa_namespace *__next_namespace(struct 
aa_namespace *root,
        if (!list_empty(&ns->sub_ns)) {
                struct aa_namespace *next;
                next = list_first_entry(&ns->sub_ns, typeof(*ns), base.list);
-               read_lock(&next->lock);
+               mutex_lock(&next->lock);
                return next;
        }
 
        /* check if the next ns is a sibling, parent, gp, .. */
        parent = ns->parent;
        while (parent) {
-               read_unlock(&ns->lock);
+               mutex_unlock(&ns->lock);
                list_for_each_entry_continue(ns, &parent->sub_ns, base.list) {
-                       read_lock(&ns->lock);
+                       mutex_lock(&ns->lock);
                        return ns;
                }
                if (parent == root)
@@ -567,7 +567,7 @@ static void *p_start(struct seq_file *f, loff_t *pos)
 
 
        /* find the first profile */
-       read_lock(&root->lock);
+       mutex_lock(&root->lock);
        profile = __first_profile(root, root);
 
        /* skip to position */
@@ -611,9 +611,9 @@ static void p_stop(struct seq_file *f, void *p)
 
        if (profile) {
                for (ns = profile->ns; ns && ns != root; ns = ns->parent)
-                       read_unlock(&ns->lock);
+                       mutex_unlock(&ns->lock);
        }
-       read_unlock(&root->lock);
+       mutex_unlock(&root->lock);
        aa_put_namespace(root);
 }
 
-- 
1.7.10.4


-- 
AppArmor mailing list
[email protected]
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/apparmor

Reply via email to