From: John Johansen Date: Thu, 16 Feb 2012 14:21:30 +0000 (-0800) Subject: AppArmor: Fix the error case for chroot relative path name lookup X-Git-Tag: firefly_0821_release~3680^2~3326^2~7 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=28042fabf43b9a8ccfaa38f8c8187cc525e53fd3;p=firefly-linux-kernel-4.4.55.git 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 Acked-by: Kees Cook --- diff --git a/security/apparmor/path.c b/security/apparmor/path.c index 9d070a7c3ffc..c31ce837fef4 100644 --- a/security/apparmor/path.c +++ b/security/apparmor/path.c @@ -91,9 +91,8 @@ static int d_namespace_path(struct path *path, char *buf, int buflen, } 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