aboutsummaryrefslogtreecommitdiff
path: root/security/apparmor/path.c
diff options
context:
space:
mode:
authorJohn Johansen <john.johansen@canonical.com>2014-07-25 04:02:08 -0700
committerMister Oyster <oysterized@gmail.com>2017-07-04 11:51:25 +0200
commitd2e1ef4f8f82121f93efc01f6258347ff21c7717 (patch)
treeb236505cb02ffb24780d647da4f93e51909fdcb8 /security/apparmor/path.c
parentf26dac94b400205a1ed473ef704ba1062b8bdece (diff)
apparmor: fix disconnected bind mnts reconnection
commit f2e561d190da7ff5ee265fa460e2d7f753dddfda upstream. Bind mounts can fail to be properly reconnected when PATH_CONNECT is specified. Ensure that when PATH_CONNECT is specified the path has a root. BugLink: http://bugs.launchpad.net/bugs/1319984 Signed-off-by: John Johansen <john.johansen@canonical.com> Acked-by: Seth Arnold <seth.arnold@canonical.com> Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Willy Tarreau <w@1wt.eu>
Diffstat (limited to 'security/apparmor/path.c')
-rw-r--r--security/apparmor/path.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/security/apparmor/path.c b/security/apparmor/path.c
index e91ffee80..ebc778092 100644
--- a/security/apparmor/path.c
+++ b/security/apparmor/path.c
@@ -141,7 +141,10 @@ static int d_namespace_path(struct path *path, char *buf, int buflen,
error = -EACCES;
if (*res == '/')
*name = res + 1;
- }
+ } else if (*res != '/')
+ /* CONNECT_PATH with missing root */
+ error = prepend(name, *name - buf, "/", 1);
+
}
out: