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
Showing the changes to security (1 of 1 file). Show all
Unified · Split
| @@ -141,7 +141,10 @@ static int d_namespace_path(const struct path *path, char *buf, int buflen, · 140 unmodified lines | |||
| 141 | error = -EACCES; | 141 | error = -EACCES; |
| 142 | if (*res == '/') | 142 | if (*res == '/') |
| 143 | *name = res + 1; | 143 | *name = res + 1; |
| 144 | } | 144 | } else if (*res != '/') |
| 145 | /* CONNECT_PATH with missing root */ | ||
| 146 | error = prepend(name, *name - buf, "/", 1); | ||
| 147 | |||
| 145 | } | 148 | } |
| 146 | 149 | ||
| 147 | out: | 150 | out: |