Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp1859745pxu; Fri, 9 Oct 2020 01:20:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwAEHBsSUhCQspgwYSoYZlr5LcmWOo3NT7fK01uB99nojIm05J56y4vzDmeqYcCz6n5JREv X-Received: by 2002:a17:906:14d8:: with SMTP id y24mr12945023ejc.123.1602231624533; Fri, 09 Oct 2020 01:20:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602231624; cv=none; d=google.com; s=arc-20160816; b=KbWLEfyjgJ4Gt95KbZ5M9jS882yTQ8rJ91F1CemN9f3h4J+MLUji4vRs6HK7LnkbAg mIIGLTIwlMrXncGXcMXAwtx/n2WjJ+TyZAMHDSl7jr9VW5nbqMOZL8cMegsYiciskNjt MyW1JVbjqF7nyR+IQtEll8qOxQ+o6IvhFTvhZ30B8H2l2O9RRPvC3DhCxtORzhjv7jR7 Oh2Jtrwgsee+MRDOuLDd/YGjQh4T3xpFMuBx+LmpaZCOWOgb9iK7VxTSqpBwu1Uj3WI+ W+uwiYlsb8VK/+XOFyBGJllxqvAkbTr/vZQIIJQ7zxzaCaUgv2IPWkVO7gaZPJ6Bo36P nvJg== 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:references:in-reply-to:date:cc:to:from:subject :message-id; bh=KVuAS5EwjSqHQyNXFiV6o3PIcEdFD7FZJE6hXQCjymA=; b=cJjl8Zxu6NFAO654A1d+0dVCxVCInfheY37nDjwcLSQ5S38EolhCnFHiATT5gt8HxK WiAQYPLn+Dk1q6KGx/wLrTOFifGDexj3FbTYZi74oTz+c9GxEM6XgcjN11Euz/ldap16 nm6HtJM+8Yev/C1UkDu9HCKfUdYQ4hWPBrPm5uGqr4Cy7XhHOnDl7KBIG0kfcX/8hBbL EroVLahUw6VCGBE8sCf4TxoJjXUR0hcSJEf8+KSq09vektOG4zMEVwJ2vix/goxPZgSK DSBB3nw39+fMyuNCF/6zIgLxrFhCDBahfhYMpwhPnjiFROie0qs/AFEYvm0dOJuOAsN4 DDNA== 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 a24si5528961ejs.437.2020.10.09.01.20.00; Fri, 09 Oct 2020 01:20: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 S1732715AbgJIITG (ORCPT + 99 others); Fri, 9 Oct 2020 04:19:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732337AbgJIITF (ORCPT ); Fri, 9 Oct 2020 04:19:05 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F989C0613D2; Fri, 9 Oct 2020 01:19:05 -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 1kQncE-0029Tg-Uc; Fri, 09 Oct 2020 10:19:03 +0200 Message-ID: <1ec056cf3ec0953d2d1abaa05e37e89b29c7cc63.camel@sipsolutions.net> Subject: Re: [CRAZY-RFF] debugfs: track open files and release on remove From: Johannes Berg To: Greg KH Cc: linux-kernel@vger.kernel.org, nstange@suse.de, ap420073@gmail.com, David.Laight@aculab.com, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, rafael@kernel.org Date: Fri, 09 Oct 2020 10:19:02 +0200 In-Reply-To: <20201009081624.GA401030@kroah.com> References: <87v9fkgf4i.fsf@suse.de> <20201009095306.0d87c3aa13db.Ib3a7019bff15bb6308f6d259473a1648312a4680@changeid> <20201009080355.GA398994@kroah.com> <20201009081624.GA401030@kroah.com> 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-wireless@vger.kernel.org On Fri, 2020-10-09 at 10:16 +0200, Greg KH wrote: > On Fri, Oct 09, 2020 at 10:06:14AM +0200, Johannes Berg wrote: > > We used to say the proxy_fops weren't needed and it wasn't an issue, and > > then still implemented it. Dunno. I'm not really too concerned about it > > myself, only root can hold the files open and remove modules ... > > proxy_fops were needed because devices can be removed from the system at > any time, causing their debugfs files to want to also be removed. It > wasn't because of unloading kernel code. Indeed, that's true. Still, we lived with it for years. Anyway, like I said, I really just did this more to see that it _could_ be done, not to suggest that it _should_ :-) I think adding the .owner everywhere would be good, and perhaps we can somehow put a check somewhere like WARN_ON(is_module_address((unsigned long)fops) && !fops->owner); to prevent the issue in the future? johannes