Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753940AbXKSMvz (ORCPT ); Mon, 19 Nov 2007 07:51:55 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752284AbXKSMvr (ORCPT ); Mon, 19 Nov 2007 07:51:47 -0500 Received: from pentafluge.infradead.org ([213.146.154.40]:57022 "EHLO pentafluge.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752367AbXKSMvq (ORCPT ); Mon, 19 Nov 2007 07:51:46 -0500 Date: Mon, 19 Nov 2007 12:51:39 +0000 From: Christoph Hellwig To: Alexey Dobriyan Cc: akpm@osdl.org, linux-kernel@vger.kernel.org, viro@zeniv.linux.org.uk, devel@openvz.org Subject: Re: [PATCH 1/4] proc: fix NULL ->i_fop oops Message-ID: <20071119125139.GB15942@infradead.org> References: <20071116150651.GC19517@localhost.sw.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20071116150651.GC19517@localhost.sw.ru> User-Agent: Mutt/1.4.2.3i X-SRS-Rewrite: SMTP reverse-path rewritten from by pentafluge.infradead.org See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1303 Lines: 24 On Fri, Nov 16, 2007 at 06:06:51PM +0300, Alexey Dobriyan wrote: > proc_kill_inodes() can clear ->i_fop in the middle of vfs_readdir resulting in > NULL dereference during "file->f_op->readdir(file, buf, filler)". > > The solution is to remove proc_kill_inodes() completely: > a) we don't have tricky modules implementing their tricky readdir hooks which > could keeping this revoke from hell. > b) In a situation when module is gone but PDE still alive, standard readdir > will return only "." and "..", because pde->next was cleared by > remove_proc_entry(). > c) the race proc_kill_inode() destined to prevent is not completely fixed, just > race window made smaller, because vfs_readdir() is run without sb_lock held and > without file_list_lock held. Effectively, ->i_fop is cleared at random moment, > which can't fix properly anything. Nice, getting rid of this is a very good step formwards. Unfortunately we have another copy of this junk in security/selinux/selinuxfs.c:sel_remove_entries() which would need the same treatment. - 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/