summaryrefslogtreecommitdiffstats
path: root/kernel/audit_watch.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2019-11-02 18:11:41 +0100
committerAl Viro <viro@zeniv.linux.org.uk>2019-11-10 17:56:55 +0100
commit69924b89687a2923e88cc42144aea27868913d0e (patch)
tree9dd6db104f357b05bf0152fcd79a51383c2fd9f3 /kernel/audit_watch.c
parentexportfs_decode_fh(): negative pinned may become positive without the parent ... (diff)
downloadlinux-69924b89687a2923e88cc42144aea27868913d0e.tar.xz
linux-69924b89687a2923e88cc42144aea27868913d0e.zip
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 <viro@zeniv.linux.org.uk>
Diffstat (limited to 'kernel/audit_watch.c')
-rw-r--r--kernel/audit_watch.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/audit_watch.c b/kernel/audit_watch.c
index 1f31c2f1e6fc..4508d5e0cf69 100644
--- a/kernel/audit_watch.c
+++ b/kernel/audit_watch.c
@@ -351,12 +351,12 @@ static int audit_get_nd(struct audit_watch *watch, struct path *parent)
struct dentry *d = kern_path_locked(watch->path, parent);
if (IS_ERR(d))
return PTR_ERR(d);
- inode_unlock(d_backing_inode(parent->dentry));
if (d_is_positive(d)) {
/* update watch filter fields */
watch->dev = d->d_sb->s_dev;
watch->ino = d_backing_inode(d)->i_ino;
}
+ inode_unlock(d_backing_inode(parent->dentry));
dput(d);
return 0;
}