summaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorJohn Johansen <john.johansen@canonical.com>2014-07-25 13:02:08 +0200
committerJohn Johansen <john.johansen@canonical.com>2016-07-12 17:43:10 +0200
commitf2e561d190da7ff5ee265fa460e2d7f753dddfda (patch)
treeae92875ebc201cfbdcde9177d6d63eabeb937c09 /security
parentapparmor: fix update the mtime of the profile file on replacement (diff)
downloadlinux-f2e561d190da7ff5ee265fa460e2d7f753dddfda.tar.xz
linux-f2e561d190da7ff5ee265fa460e2d7f753dddfda.zip
apparmor: fix disconnected bind mnts reconnection
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>
Diffstat (limited to 'security')
-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 edddc026406b..f2616780065a 100644
--- a/security/apparmor/path.c
+++ b/security/apparmor/path.c
@@ -141,7 +141,10 @@ static int d_namespace_path(const 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: