Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755531AbbLABZi (ORCPT ); Mon, 30 Nov 2015 20:25:38 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:37830 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752173AbbLABZg (ORCPT ); Mon, 30 Nov 2015 20:25:36 -0500 Date: Mon, 30 Nov 2015 17:25:35 -0800 From: Greg Kroah-Hartman To: Nicolai Stange Cc: Alexander Viro , Jonathan Corbet , Jan Kara , "Paul E. McKenney" , Andrew Morton , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] debugfs: prevent access to possibly dead file_operations at file open Message-ID: <20151201012535.GA14614@kroah.com> References: <8737vnvzt0.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8737vnvzt0.fsf@gmail.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1291 Lines: 29 On Tue, Dec 01, 2015 at 12:21:31AM +0100, Nicolai Stange wrote: > Nothing prevents a dentry found by path lookup before a return of > __debugfs_remove() to actually get opened after that return. Now, after > the return of __debugfs_remove(), there are no guarantees whatsoever > regarding the memory the corresponding inode's file_operations object > had been kept in. > > Since __debugfs_remove() is seldomly invoked, usually from module exit > handlers only, the race is hard to trigger and the impact is very low. > > A discussion of the problem outlined above as well as a suggested > solution can be found in the (sub-)thread rooted at > > http://lkml.kernel.org/g/20130401203445.GA20862@ZenIV.linux.org.uk > ("Yet another pipe related oops.") > > Basically, Greg KH suggests to introduce an intermediate fops and > Al Viro points out that a pointer to the original ones may be stored in > ->d_fsdata. Nice work, thanks for doing this. I'll review it in a week or so when I've caught up on my huge pending patch queue... greg k-h -- 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/