Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp1810579pxu; Thu, 8 Oct 2020 23:36:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwLcsb8WNkB4CxBdjt/YI7wIkiPFf9Zc7q1zAOLGIjDw9HRNGA3RVRst6Pk7epFWIGJQLb1 X-Received: by 2002:a50:a455:: with SMTP id v21mr10409722edb.180.1602225384211; Thu, 08 Oct 2020 23:36:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602225384; cv=none; d=google.com; s=arc-20160816; b=G2y0h2daBL8I6mDES3ROAGPkwdMy4UHEYeWb7k09piNw3xdJDzeCCF/eQZHT4Hvl2R DufpB/5GrVMjfUiOh3AEiKntM7tqg7q90+BL8pEuBsFHxwhAe50il7xaGFAJmkeGDmMw /TazsHHUL7RgKFBaYCD9/jiYcczgBS6iFaSQSbqfVy/6TM/qMRNsRoMtWkcFTmogqRtO 6y7dGWrCJNNDEMWb8f5BXnuYdGedpEE6RK4/eIJ2hVvLcFr0F4wcqU986rEdjBO9bW4N ja13dJjBZzlj+eTVw0eB9YuKzxtIV2HYzbEUR0DDasG8Mqcj4jZcoFL9Xjo+xrdZf32h j8/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:message-id:in-reply-to:date:references:subject:cc:to :from; bh=B1D7pH1IMOqfiKGG49vyV5O8JLA3UBYF1DMtgwLN/xg=; b=G0/EDB9ZOOKYUJWMOofwGhV2D+guOVXXfJvQm0sd2CBlMwroYqAx3xB/pMe6861hg1 HlVfr62XnsIaJ69+oQCNs5ycqw4DkmeYf2DFV6TLqJLj4ujPeCaKQ94KiwT7stJOHd+T yK+mduyudBQPhaeZ0AQCp3Co/Wmw2m5dh7C0YWj9+MCJSOdbeMSD59tCFY1WJfGiTf5k lXLThSA/aLbsSoEwECAe+sd+3EYmajIVwAl/+fHtUACST0gx7LkCnRnPDNxj26ICA+Fl d5hCGW4d7Szbbl7bSg5gD0NGePbODLQo/vXmPdCbCZEOTRF20RKsxVJH+sb8Tu6/T0R9 3kuA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qo18si5510907ejb.161.2020.10.08.23.35.58; Thu, 08 Oct 2020 23:36:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731557AbgJIFjC convert rfc822-to-8bit (ORCPT + 99 others); Fri, 9 Oct 2020 01:39:02 -0400 Received: from mx2.suse.de ([195.135.220.15]:43540 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729347AbgJIFjC (ORCPT ); Fri, 9 Oct 2020 01:39:02 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 135A7ACAC; Fri, 9 Oct 2020 05:39:00 +0000 (UTC) From: Nicolai Stange To: Taehee Yoo Cc: Johannes Berg , David Laight , "davem\@davemloft.net" , "kuba\@kernel.org" , "netdev\@vger.kernel.org" , Nicolai Stange , "linux-wireless\@vger.kernel.org" , "wil6210\@qti.qualcomm.com" , "brcm80211-dev-list\@cypress.com" , "b43-dev\@lists.infradead.org" , "linux-bluetooth\@vger.kernel.org" Subject: Re: [PATCH net 000/117] net: avoid to remove module when its debugfs is being used References: <20201008155048.17679-1-ap420073@gmail.com> <1cbb69d83188424e99b2d2482848ae64@AcuMS.aculab.com> <62f6c2bd11ed8b25c1cd4462ebc6db870adc4229.camel@sipsolutions.net> Date: Fri, 09 Oct 2020 07:38:59 +0200 In-Reply-To: (Taehee Yoo's message of "Fri, 9 Oct 2020 01:37:26 +0900") Message-ID: <87r1q8gdqk.fsf@suse.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Taehee Yoo writes: > On Fri, 9 Oct 2020 at 01:14, Johannes Berg wrote: > 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. Yes, the file_operations' ->release() to be more specific -- that's not covered by debugfs' proxy fops. >> > 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? > > I didn't try to fix this issue in the common code(debugfs). > Because I thought It's a typical pattern of panic and THIS_MODULE > can fix it clearly. > So I couldn't think there is a root reason in the common code. That's correct, ->owner should get set properly, c.f. my other mail in this thread. Thanks, Nicolai -- SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany (HRB 36809, AG Nürnberg), GF: Felix Imendörffer