From mboxrd@z Thu Jan 1 00:00:00 1970 From: Johannes Berg Date: Thu, 08 Oct 2020 18:14:15 +0200 Subject: [PATCH net 000/117] net: avoid to remove module when its debugfs is being used In-Reply-To: <1cbb69d83188424e99b2d2482848ae64@AcuMS.aculab.com> (sfid-20201008_181146_072575_728542C7) References: <20201008155048.17679-1-ap420073@gmail.com> <1cbb69d83188424e99b2d2482848ae64@AcuMS.aculab.com> (sfid-20201008_181146_072575_728542C7) Message-ID: <62f6c2bd11ed8b25c1cd4462ebc6db870adc4229.camel@sipsolutions.net> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: David Laight , 'Taehee Yoo' , "davem@davemloft.net" , "kuba@kernel.org" , "netdev@vger.kernel.org" , Nicolai Stange Cc: "linux-wireless@vger.kernel.org" , "wil6210@qti.qualcomm.com" , "brcm80211-dev-list@cypress.com" , "b43-dev@lists.infradead.org" , "linux-bluetooth@vger.kernel.org" On Thu, 2020-10-08 at 15:59 +0000, David Laight wrote: > From: Taehee Yoo > > Sent: 08 October 2020 16:49 > > > > When debugfs file is opened, its module should not be removed until > > it's closed. > > Because debugfs internally uses the module's data. > > So, it could access freed memory. > > > > In order to avoid panic, it just sets .owner to THIS_MODULE. > > So that all modules will be held when its debugfs file is opened. > > Can't you fix it in common code? Yeah I was just wondering that too - weren't the proxy_fops even already intended to fix this? The modules _should_ be removing the debugfs files, and then the proxy_fops should kick in, no? So where's the issue? johannes