linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH (untested)] vfs: fix d_inode_lookup() dentry ref leak
@ 2012-02-03 13:25 Miklos Szeredi
  2012-02-03 13:30 ` Al Viro
  0 siblings, 1 reply; 2+ messages in thread
From: Miklos Szeredi @ 2012-02-03 13:25 UTC (permalink / raw)
  To: Al Viro, Josef Bacik; +Cc: linux-fsdevel, linux-kernel

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)) {

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-02-03 13:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-03 13:25 [PATCH (untested)] vfs: fix d_inode_lookup() dentry ref leak Miklos Szeredi
2012-02-03 13:30 ` Al Viro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).