Commit cffee16e authored by John Johansen's avatar John Johansen

apparmor: fix long path failure due to disconnected path

BugLink: http://bugs.launchpad.net/bugs/955892

All failures from __d_path where being treated as disconnected paths,
however __d_path can also fail when the generated pathname is too long.

The initial ENAMETOOLONG error was being lost, and ENAMETOOLONG was only
returned if the subsequent dentry_path call resulted in that error.  Other
wise if the path was split across a mount point such that the dentry_path
fit within the buffer when the __d_path did not the failure was treated
as a disconnected path.
Signed-off-by: default avatarJohn Johansen <john.johansen@canonical.com>
parent bf83208e
...@@ -94,6 +94,8 @@ static int d_namespace_path(struct path *path, char *buf, int buflen, ...@@ -94,6 +94,8 @@ static int d_namespace_path(struct path *path, char *buf, int buflen,
* be returned. * be returned.
*/ */
if (!res || IS_ERR(res)) { if (!res || IS_ERR(res)) {
if (PTR_ERR(res) == -ENAMETOOLONG)
return -ENAMETOOLONG;
connected = 0; connected = 0;
res = dentry_path_raw(path->dentry, buf, buflen); res = dentry_path_raw(path->dentry, buf, buflen);
if (IS_ERR(res)) { if (IS_ERR(res)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment