diff options
author | John Johansen <john.johansen@canonical.com> | 2012-05-22 08:22:21 -0700 |
---|---|---|
committer | John Rigby <john.rigby@linaro.org> | 2012-06-24 16:28:19 -0600 |
commit | 6812e71dd22f80b279cf03b3eacb9f88765d882c (patch) | |
tree | 60c4e51f917a7656993efb36552433157f0f26c3 /security | |
parent | 22bf16a3fc178b48e0347e7d89017e370b987c1c (diff) |
UBUNTU: SAUCE: apparmor: fix long path failure due to disconnected path
OriginalLocation: security/next cffee16e8b997ab947de661e8820e486b0830c94
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: John Johansen <john.johansen@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Diffstat (limited to 'security')
-rw-r--r-- | security/apparmor/path.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/security/apparmor/path.c b/security/apparmor/path.c index 2daeea4f926..e91ffee8016 100644 --- a/security/apparmor/path.c +++ b/security/apparmor/path.c @@ -94,6 +94,8 @@ static int d_namespace_path(struct path *path, char *buf, int buflen, * be returned. */ if (!res || IS_ERR(res)) { + if (PTR_ERR(res) == -ENAMETOOLONG) + return -ENAMETOOLONG; connected = 0; res = dentry_path_raw(path->dentry, buf, buflen); if (IS_ERR(res)) { |