From: John Johansen Date: Fri, 25 Jul 2014 11:02:08 +0000 (-0700) Subject: apparmor: fix disconnected bind mnts reconnection X-Git-Tag: v3.10.107~157 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=31d3307054aececcc1197eb119ebc35a5f4b60fc;p=thirdparty%2Fkernel%2Fstable.git 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 Acked-by: Seth Arnold Signed-off-by: Jiri Slaby Signed-off-by: Willy Tarreau --- diff --git a/security/apparmor/path.c b/security/apparmor/path.c index e91ffee801628..ebc7780926b82 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: