Skip to content

Commit 729b8a3

Browse files
dhowellsAl Viro
authored and
Al Viro
committed
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: David Howells <[email protected]> Signed-off-by: Al Viro <[email protected]>
1 parent 7ac2856 commit 729b8a3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

security/apparmor/path.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ static int d_namespace_path(struct path *path, char *buf, int buflen,
114114
* security_path hooks as a deleted dentry except without an inode
115115
* allocated.
116116
*/
117-
if (d_unlinked(path->dentry) && path->dentry->d_inode &&
117+
if (d_unlinked(path->dentry) && d_is_positive(path->dentry) &&
118118
!(flags & PATH_MEDIATE_DELETED)) {
119119
error = -ENOENT;
120120
goto out;

0 commit comments

Comments
 (0)