Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp2050599rdh; Sat, 25 Nov 2023 11:29:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IErP2zcP2f+eY1hjnk9v9aBd9+Lg12rLZo3qWRqmbkRSRuj+I06+exft5XRfeKErsHaEYvG X-Received: by 2002:a17:90b:4b0e:b0:285:b687:b831 with SMTP id lx14-20020a17090b4b0e00b00285b687b831mr1428381pjb.10.1700940559888; Sat, 25 Nov 2023 11:29:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700940559; cv=none; d=google.com; s=arc-20160816; b=ltIQfeVjY+S5cKP7R8ptzaGOQCunwEwBRHs2BH3S2/io5UP8rVFPMoNPDtkBpINwmk CmkdZzh1Q3QxO6TGESKj+s9cxmO6LeyEbKVlewf7I5/q/aigbOqQ8YZfwkb92Lv9lw8f M/ZiYgXwWKVKeAF7J/l8irDUXqsxHA7x4MyDDnJNDSEKlwb20kX1tBE/rXHCElbbYFHz Ia2Gf2axma4YZJqxHgeUv88/lcxUoTW3+Nm8C8CzlSsAqsPnB0d3sMiaR6umefZ5QhbV V6zQO6MAK3QMtAIlZhJ5cpWuoFChwkRx0SmHpf7wtaMx3AoHjYYk0bvKSLPornWj1Lnq GVmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=iaPCwgWorzRdZwofvFuSsqc14KS9yA5rD5pjvKL1b9A=; fh=jIpZv0zZNU0vrrcOpQAlU8+YmfMvG+m7s+dlF7NuaZs=; b=cIP/Qz8YvxaG5OH685j89TEt/ovbap7bZbjeUZ57VP/0Xt0ojmZLRLa/XWfTOAm/me 5VQMJTbF1fYCSJN9gDM9TY6pqx1DoXi9UEm8ltvg2t5ZYzfvZ4B0oc4sdzUWskKkHMLn FvENpqRKwWeKMZdY4vgXniECL0UJ5oY3TdizNcfD6FpuWP46qBukpwxY5fC9fd5ObzTz PuW/1mhhEPZJqO3KaBrMKIw9rX2MRpGzvroDX2ISg5xzXGi0ez62ixT6trCc/Q7hmSky JluG+pdJhARrfzsZOA+nEzJQPRYQIrUzWXjF5nFMJtZNGORElHSrCINRllQ0Y7lcJP2v 97QA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BFVN7MV2; spf=pass (google.com: domain of linux-wireless+bounces-78-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-78-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id x5-20020a1709028ec500b001cc1a3e42d8si5729726plo.324.2023.11.25.11.29.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Nov 2023 11:29:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-78-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BFVN7MV2; spf=pass (google.com: domain of linux-wireless+bounces-78-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-78-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 0C449B20F6C for ; Sat, 25 Nov 2023 19:29:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 061CE2F848; Sat, 25 Nov 2023 19:29:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="BFVN7MV2" X-Original-To: linux-wireless@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D0AE51EB3B for ; Sat, 25 Nov 2023 19:29:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1BA97C433C8; Sat, 25 Nov 2023 19:29:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1700940552; bh=T9ybAOqdYbePgwxUcm0MrumA2w7ABJfsHzDYHj7SqKQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=BFVN7MV2Y/JG6IVN4YyAmqIrmLQmKorlO5J9sbOtBeOuXALW2jxWNWfO9K7HyyqTV 3AAgjmxIgRS9904e3OM972kEl0kCcX1udmWXP+fIUJE4RAOvztfkoHEn8NB+rztkXH BsaAtZ2RpVxYYTzKs8l2+wmubXYxSSMGUju83la0= Date: Sat, 25 Nov 2023 19:29:10 +0000 From: Greg Kroah-Hartman To: Johannes Berg Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, "Rafael J. Wysocki" Subject: Re: [PATCH v2 1/6] debugfs: fix automount d_fsdata usage Message-ID: <2023112555-squabble-ended-6b8d@gregkh> References: <20231124162522.16344-7-johannes@sipsolutions.net> <20231124172522.01928f127e73.I64fe5615568e87f9ae2d7fb2ac4e5fa96924cb50@changeid> <2023112519-reprocess-backtrack-0732@gregkh> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Sat, Nov 25, 2023 at 07:31:47PM +0100, Johannes Berg wrote: > On Sat, 2023-11-25 at 14:48 +0000, Greg Kroah-Hartman wrote: > > On Fri, Nov 24, 2023 at 05:25:24PM +0100, Johannes Berg wrote: > > > From: Johannes Berg > > > > > > debugfs_create_automount() stores a function pointer in d_fsdata, > > > but since commit 7c8d469877b1 ("debugfs: add support for more > > > elaborate ->d_fsdata") debugfs_release_dentry() will free it, now > > > conditionally on DEBUGFS_FSDATA_IS_REAL_FOPS_BIT, but that's not > > > set for the function pointer in automount. As a result, removing > > > an automount dentry would attempt to free the function pointer. > > > Luckily, the only user of this (tracing) never removes it. > > > > > > Nevertheless, it's safer if we just handle the fsdata in one way, > > > namely either DEBUGFS_FSDATA_IS_REAL_FOPS_BIT or allocated. Thus, > > > change the automount to allocate it, and use the real_fops in the > > > data to indicate whether or not automount is filled, rather than > > > adding a type tag. At least for now this isn't actually needed, > > > but the next changes will require it. > > > > > > Also check in debugfs_file_get() that it gets only called > > > on regular files, just to make things clearer. > > > > > > Signed-off-by: Johannes Berg > > > --- > > > v2: add missing kfree() pointed out by smatch > > > > Acked-by: Greg Kroah-Hartman > > I have to fix the Kconfig issue in one of the later (wireless) patches, > but does that mean you'd actually prefer the debugfs changes go through > the wireless tree, together with the code using it? I'm all for you taking these through the wireless tree, have fun! greg k-h