Messages in this thread Patch in this message | | | From | Miklos Szeredi <> | Subject | [PATCH (untested)] vfs: fix d_inode_lookup() dentry ref leak | Date | Fri, 03 Feb 2012 14:25:18 +0100 |
| |
From: Miklos Szeredi <mszeredi@suse.cz>
d_inode_lookup() appears to leak a dentry reference on IS_DEADDIR().
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> CC: stable@vger.kernel.org --- fs/namei.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Index: linux-2.6/fs/namei.c =================================================================== --- linux-2.6.orig/fs/namei.c 2012-02-03 14:14:52.000000000 +0100 +++ linux-2.6/fs/namei.c 2012-02-03 14:15:48.000000000 +0100 @@ -1095,8 +1095,10 @@ static struct dentry *d_inode_lookup(str struct dentry *old; /* Don't create child dentry for a dead directory. */ - if (unlikely(IS_DEADDIR(inode))) + if (unlikely(IS_DEADDIR(inode))) { + dput(dentry); return ERR_PTR(-ENOENT); + } old = inode->i_op->lookup(inode, dentry, nd); if (unlikely(old)) {
| |