From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH v2] net: delete /proc THIS_MODULE references Date: Mon, 15 Jan 2018 14:18:00 -0800 Message-ID: <20180115141800.42cc412a@xeon-e3> References: <20180115214240.GC6942@avx2> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: davem@davemloft.net, netdev@vger.kernel.org To: Alexey Dobriyan Return-path: Received: from mail-pl0-f67.google.com ([209.85.160.67]:35994 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750733AbeAOWSD (ORCPT ); Mon, 15 Jan 2018 17:18:03 -0500 Received: by mail-pl0-f67.google.com with SMTP id q2so4638131pll.3 for ; Mon, 15 Jan 2018 14:18:03 -0800 (PST) In-Reply-To: <20180115214240.GC6942@avx2> Sender: netdev-owner@vger.kernel.org List-ID: On Tue, 16 Jan 2018 00:42:40 +0300 Alexey Dobriyan wrote: > /proc has been ignoring struct file_operations::owner field for 10 years. > Specifically, it started with commit 786d7e1612f0b0adb6046f19b906609e4fe8b1ba > ("Fix rmmod/read/write races in /proc entries"). Notice the chunk where > inode->i_fop is initialized with proxy struct file_operations for > regular files: > > - if (de->proc_fops) > - inode->i_fop = de->proc_fops; > + if (de->proc_fops) { > + if (S_ISREG(inode->i_mode)) > + inode->i_fop = &proc_reg_file_ops; > + else > + inode->i_fop = de->proc_fops; > + } > > VFS stopped pinning module at this point. > > Signed-off-by: Alexey Dobriyan What happens if /proc file for the module is open and the module is unloaded? Just because it is old doesn't mean that it wasn't a bug.