From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 92C4AC433DF for ; Thu, 8 Oct 2020 16:14:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3D169221F1 for ; Thu, 8 Oct 2020 16:14:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730102AbgJHQOa (ORCPT ); Thu, 8 Oct 2020 12:14:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44960 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729164AbgJHQO3 (ORCPT ); Thu, 8 Oct 2020 12:14:29 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D24BFC061755; Thu, 8 Oct 2020 09:14:29 -0700 (PDT) Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.94) (envelope-from ) id 1kQYYa-001jkw-PM; Thu, 08 Oct 2020 18:14:16 +0200 Message-ID: <62f6c2bd11ed8b25c1cd4462ebc6db870adc4229.camel@sipsolutions.net> Subject: Re: [PATCH net 000/117] net: avoid to remove module when its debugfs is being used From: Johannes Berg 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" Date: Thu, 08 Oct 2020 18:14:15 +0200 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) Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5 (3.36.5-1.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: 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