Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 729b8a3d authored by David Howells's avatar David Howells Committed by Al Viro
Browse files

Apparmor: Use d_is_positive/negative() rather than testing dentry->d_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: default avatarDavid Howells <dhowells@redhat.com>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 7ac2856d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;