Skip to content

Commit

Permalink
Apparmor: Use d_is_positive/negative() rather than testing dentry->d_…
Browse files Browse the repository at this point in the history
…inode

Use d_is_positive(dentry) or d_is_negative(dentry) rather than testing
dentry->d_inode as the dentry may cover another layer that has an inode when
the top layer doesn't or may hold a 0,0 chardev that's actually a whiteout.

Signed-off-by: David Howells <[email protected]>
Signed-off-by: Al Viro <[email protected]>
  • Loading branch information
dhowells authored and Al Viro committed Feb 22, 2015
1 parent 7ac2856 commit 729b8a3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion security/apparmor/path.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ static int d_namespace_path(struct path *path, char *buf, int buflen,
* security_path hooks as a deleted dentry except without an inode
* allocated.
*/
if (d_unlinked(path->dentry) && path->dentry->d_inode &&
if (d_unlinked(path->dentry) && d_is_positive(path->dentry) &&
!(flags & PATH_MEDIATE_DELETED)) {
error = -ENOENT;
goto out;
Expand Down

0 comments on commit 729b8a3

Please sign in to comment.