aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Johansen2012-05-16 13:01:05 -0500
committerJohn Johansen2012-05-18 13:09:52 -0500
commitcffee16e8b997ab947de661e8820e486b0830c94 (patch)
treef71adb789f6d850367d35b34955f038239f739b3 /security/apparmor
parentbf83208e0b7f5938f5a7f6d9dfa9960bf04692fa (diff)
downloadkernel-common-cffee16e8b997ab947de661e8820e486b0830c94.tar.gz
kernel-common-cffee16e8b997ab947de661e8820e486b0830c94.tar.xz
kernel-common-cffee16e8b997ab947de661e8820e486b0830c94.zip
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: John Johansen <john.johansen@canonical.com>
Diffstat (limited to 'security/apparmor')
-rw-r--r--security/apparmor/path.c2
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,
94 * be returned. 94 * be returned.
95 */ 95 */
96 if (!res || IS_ERR(res)) { 96 if (!res || IS_ERR(res)) {
97 if (PTR_ERR(res) == -ENAMETOOLONG)
98 return -ENAMETOOLONG;
97 connected = 0; 99 connected = 0;
98 res = dentry_path_raw(path->dentry, buf, buflen); 100 res = dentry_path_raw(path->dentry, buf, buflen);
99 if (IS_ERR(res)) { 101 if (IS_ERR(res)) {