]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
apparmor: fix oops in pivot_root mediation
authorJohn Johansen <john.johansen@canonical.com>
Wed, 28 Sep 2016 05:14:12 +0000 (22:14 -0700)
committerTim Gardner <tim.gardner@canonical.com>
Mon, 20 Feb 2017 03:57:58 +0000 (20:57 -0700)
BugLink: http://bugs.launchpad.net/bugs/1611078
Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
security/apparmor/mount.c

index 5ca4ccf4421ab8e30680231923398a1883ff9e15..53420626f08d0fdcfd3d2a6840ca9e5a07aab79b 100644 (file)
@@ -612,6 +612,9 @@ static struct aa_label *build_pivotroot(struct aa_profile *profile,
        AA_BUG(!new_path);
        AA_BUG(!old_path);
 
+       if (profile_unconfined(profile))
+               return aa_get_newest_label(&profile->label);
+
        error = aa_path_name(old_path, path_flags(profile, old_path),
                             old_buffer, &old_name, &info,
                             profile->disconnected);
@@ -651,7 +654,7 @@ audit:
        } else if (target)
                return target;
 
-       return aa_get_label(&profile->label);
+       return aa_get_newest_label(&profile->label);
 }
 
 int aa_pivotroot(struct aa_label *label, const struct path *old_path,