Skip to content

Commit

Permalink
AppArmor: Fix the error case for chroot relative path name lookup
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
John Johansen committed Feb 27, 2012
1 parent 38305a4 commit 28042fa
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions security/apparmor/path.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 28042fa

Please sign in to comment.