Skip to content

Commit

Permalink
fix bogus path_put() of nd->root after some unlazy_walk() failures
Browse files Browse the repository at this point in the history
Failure to grab reference to parent dentry should go through the
same cleanup as nd->seq mismatch.  As it is, we might end up with
caller thinking it needs to path_put() nd->root, with obvious
nasty results once we'd hit that bug enough times to drive the
refcount of root dentry all the way to zero...

Signed-off-by: Al Viro <[email protected]>
  • Loading branch information
Al Viro committed Nov 29, 2013
1 parent 2e7babf commit d870b4a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -513,8 +513,7 @@ static int unlazy_walk(struct nameidata *nd, struct dentry *dentry)

if (!lockref_get_not_dead(&parent->d_lockref)) {
nd->path.dentry = NULL;
rcu_read_unlock();
return -ECHILD;
goto out;
}

/*
Expand Down

0 comments on commit d870b4a

Please sign in to comment.