AppArmor: Fix the error case for chroot relative path name lookup
When a chroot relative pathname lookup fails it is falling through to
do a d_absolute_path lookup. This is incorrect as d_absolute_path should
only be used to lookup names for namespace absolute paths.
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Kees Cook <kees@ubuntu.com>
diff --git a/security/apparmor/path.c b/security/apparmor/path.c
index 9d070a7..c31ce83 100644
--- a/security/apparmor/path.c
+++ b/security/apparmor/path.c
@@ -91,9 +91,8 @@
}
path_put(&root);
connected = 0;
- }
-
- res = d_absolute_path(path, buf, buflen);
+ } else
+ res = d_absolute_path(path, buf, buflen);
*name = res;
/* handle error conditions - and still allow a partial path to