Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp1873056pxu; Fri, 9 Oct 2020 01:48:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxYvShC8A70FH7DTFnJXs3dCAzSfV/0Pm9z/4S/2oV4iLTQWErE2YgJz/5c9dI2EDtQfQEN X-Received: by 2002:a05:6402:1298:: with SMTP id w24mr12837686edv.280.1602233315650; Fri, 09 Oct 2020 01:48:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602233315; cv=none; d=google.com; s=arc-20160816; b=Ceg8ck2RalCcY8mR0kcU6XG972lM+adS1TQbxmyRBAPWVVvqKLxmVErJGop2HVcveT 8ZxhNgMmRJllxp8KcmNnrMDT6geKnVOGYhTO35eRvJGAKTiHbaTZaeaF0EYnaBjyzK1P uCOoDdAY1NYuhyd+UH5LTrCxJ7xK/U3s+BmaQXA8iuFsXPxidjgxIkz84jXQfDjZY8v0 UNLa1vST1hr8iz+iqcYTo739yFX3hCRVbH8Ul0Dzf3dkA++sslaOhzGmyAMyQUXbJg9l RVWaQaHYwIanuxm/bncfCPf/Kg7fcsgp7b8rf+9gRXGCYY65JGJj6yYjtd9d33SlwKEd yW1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Ts8msJiLf9BC8d6HghCXnJzNhKcSpr0lMkPpSFw03sY=; b=sDid4kFpQLBwayc2mMMb9votV6DCAHIOa7rmJ2dto6e0t9wtwmy8TJ+3v+ez1Fx73V +tQklj/JMQ7lw/iSZjAVnvVacxTB5q9AKobaDU38AuXRaX2GHZVzgwUuabZe2Jrl6I+d zoHj42WB1qFCRBSY1SlB45N8UIVBgAURZOGAOA8vm99G6uM6kphdiwQqS2NZJAEUTR+W fOuo5FNjcluubZjdPZdtR8z9PvAuFwo60lD/Vucvxh7NdnjVmNG2azAYdZMiPQLx3evt 1zFwHJiYVEgr0lIzxmuDircrXmz9RRrQF1OKspOPY2ZRjW09pV2x1/DgOiYDGyRz9kwC yR0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1GvnP2Ko; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d18si5774971ejz.660.2020.10.09.01.48.10; Fri, 09 Oct 2020 01:48:35 -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; dkim=pass header.i=@kernel.org header.s=default header.b=1GvnP2Ko; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732900AbgJIIqo (ORCPT + 99 others); Fri, 9 Oct 2020 04:46:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:51332 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730726AbgJIIqn (ORCPT ); Fri, 9 Oct 2020 04:46:43 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A7D79215A4; Fri, 9 Oct 2020 08:46:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602233203; bh=wDVSK9lDifu555hYLt/QcE1K+Rrce7ovaPwUry7eR9U=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=1GvnP2KovqKJ/n9WjwQvNaPfJPHa2OblOoJcaPU1QGZ4dTQlUmdw5ay8S/AUmNIfk NBEQEx1BQLZHuBYsHTWVZ37sKUN9P0G1tABbnC+PCnh4gwZP9fA8UF40JTf/bFxORl pSkgGCZe6oFXyZUrt+hdSh0bjojvydvgPCQwo7Cs= Date: Fri, 9 Oct 2020 10:47:29 +0200 From: Greg KH To: Johannes Berg 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 Subject: Re: [CRAZY-RFF] debugfs: track open files and release on remove Message-ID: <20201009084729.GA406522@kroah.com> References: <87v9fkgf4i.fsf@suse.de> <20201009095306.0d87c3aa13db.Ib3a7019bff15bb6308f6d259473a1648312a4680@changeid> <20201009080355.GA398994@kroah.com> <20201009081624.GA401030@kroah.com> <1ec056cf3ec0953d2d1abaa05e37e89b29c7cc63.camel@sipsolutions.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1ec056cf3ec0953d2d1abaa05e37e89b29c7cc63.camel@sipsolutions.net> Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Fri, Oct 09, 2020 at 10:19:02AM +0200, Johannes Berg wrote: > 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. Because no one wanted to fix the code, not because it was correct :) > Anyway, like I said, I really just did this more to see that it _could_ > be done, not to suggest that it _should_ :-) Agreed. > 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? That will fail for all of the debugfs_create_* operations, as there is only one set of file operations for all of the different files created with these calls. Which, now that I remember it, is why we went down the proxy "solution" in the first place :( thanks, greg k-h