lkml.org 
[lkml]   [2012]   [Feb]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH (untested)] vfs: fix d_inode_lookup() dentry ref leak
Date
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)) {

\
 
 \ /
  Last update: 2012-02-03 14:29    [W:2.214 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site