Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965061Ab2B1BJ5 (ORCPT ); Mon, 27 Feb 2012 20:09:57 -0500 Received: from mail-pw0-f46.google.com ([209.85.160.46]:46792 "EHLO mail-pw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965023Ab2B1BIU (ORCPT ); Mon, 27 Feb 2012 20:08:20 -0500 Authentication-Results: mr.google.com; spf=pass (google.com: domain of gregkh@linuxfoundation.org designates 10.68.130.233 as permitted sender) smtp.mail=gregkh@linuxfoundation.org MIME-Version: 1.0 Message-Id: <20120228010430.385984754@linuxfoundation.org> User-Agent: quilt/0.51-17.1 Date: Mon, 27 Feb 2012 17:04:40 -0800 From: Greg KH To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, Miklos Szeredi , Al Viro Subject: [ 11/72] vfs: fix d_inode_lookup() dentry ref leak In-Reply-To: <20120228010511.GA8453@kroah.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1115 Lines: 39 3.2-stable review patch. If anyone has any objections, please let me know. ------------------ From: Miklos Szeredi commit e188dc02d3a9c911be56eca5aa114fe7e9822d53 upstream. d_inode_lookup() leaks a dentry reference on IS_DEADDIR(). Signed-off-by: Miklos Szeredi Signed-off-by: Al Viro Signed-off-by: Greg Kroah-Hartman --- fs/namei.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/fs/namei.c +++ b/fs/namei.c @@ -1094,8 +1094,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)) { -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/