Skip to content

Commit 69924b8

Browse files
author
Al Viro
committed
audit_get_nd(): don't unlock parent too early
if the child has been negative and just went positive under us, we want coherent d_is_positive() and ->d_inode. Don't unlock the parent until we'd done that work... Signed-off-by: Al Viro <[email protected]>
1 parent a2ece08 commit 69924b8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/audit_watch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,12 +351,12 @@ static int audit_get_nd(struct audit_watch *watch, struct path *parent)
351351
struct dentry *d = kern_path_locked(watch->path, parent);
352352
if (IS_ERR(d))
353353
return PTR_ERR(d);
354-
inode_unlock(d_backing_inode(parent->dentry));
355354
if (d_is_positive(d)) {
356355
/* update watch filter fields */
357356
watch->dev = d->d_sb->s_dev;
358357
watch->ino = d_backing_inode(d)->i_ino;
359358
}
359+
inode_unlock(d_backing_inode(parent->dentry));
360360
dput(d);
361361
return 0;
362362
}

0 commit comments

Comments
 (0)