diff options
author | John Johansen <john.johansen@canonical.com> | 2014-07-25 15:02:08 +0400 |
---|---|---|
committer | Jiri Slaby <jslaby@suse.cz> | 2017-01-27 13:16:08 +0300 |
commit | 393776e08a7d128a7eda2043b313299566344ea0 (patch) | |
tree | 816f1e19848994fa79627573d56a50c47ab73de7 /security | |
parent | 40c541cf20d052b3dff9f68687f68ffa5ca9fdeb (diff) | |
download | linux-393776e08a7d128a7eda2043b313299566344ea0.tar.xz |
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>
Diffstat (limited to 'security')
-rw-r--r-- | security/apparmor/path.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/security/apparmor/path.c b/security/apparmor/path.c index 35b394a75d76..0f232e5cd18c 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: |