Received: by 2002:a05:7412:98c1:b0:fa:551:50a7 with SMTP id kc1csp1692718rdb; Mon, 8 Jan 2024 07:22:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IFQLsbu/zjNPDs1eBT4V3cmRWCZe0hH2dvS+FDYVmobE6EVSWI6geF8c3ssypiu6Q40tJzg X-Received: by 2002:a05:6214:20e7:b0:680:f58:9ed0 with SMTP id 7-20020a05621420e700b006800f589ed0mr2751813qvk.93.1704727368305; Mon, 08 Jan 2024 07:22:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704727368; cv=none; d=google.com; s=arc-20160816; b=QqvZB3SWaTptbAlpL+azwDDaXVTzTRBDKxMLF7V4r/WoWTgbpiq1ytj4AC3a7nN928 ugPY5Tzx9spUzwpUZ/BO5d5YzCvErq6nJR82ZI5Xpw5qfPYpIP8oW6BIQLUisAS5HuF2 BpZft8+jEDBLcQyQiY8kQrwqvUW13vPCuDAHOwTFIcI25YFngls8JAvPqdyzjYTFtRcN A9sBmff/hxknpbAHCdYUiFnTRN/ht/IdcZMVDHcVOgrMzFwo6WYv/UZ4PRgsAzRAj49t 6kBU2w0uVxV2nPze+5UIW+LSGROlyjLqJ0ZcyZ19yQJrSlsUvSExUptbNjfZeieg2UlH CJYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date; bh=Z/I7swuRM1tfL5GmVSOOeJx1hB2cf6Toq8fBb5Z8rgA=; fh=d0Ct0J+JiGzn8473V3+2DIY7dSmzIWejAPUIcKsWBu0=; b=s/4yMGrmG5splKx9dvBHSsS/KRj1oLfpS/dfKllhor0ZQpyAuojianumo7dikiNM0m 39rn1lZwYZ+X9i3T5N/jzBDOic9Sa4jR82YKmkZtwuESluxnG4Dwg5e1hIusS2R0aqp/ cTazX97WVL4Z1Za/rIVPOdndvWuKU+55OeI+LcDz2R8Y5VrV87C4RxeJf+tTW7QnZ5wv CYzieX1xeCkFgWWPly5mKGm/kvsYH049+1jPtIjnUa3/JJm6DCFW1vd8FWhOoaNQA3vF NUlwr5B3PhIHHi89zILy2+pTNYpg1WWGqTvLbnC5qBrIJuzpSZyRLzJ0HeyJpBaEnNhh 8Tuw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-19756-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-19756-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id t7-20020a0c8d87000000b0067f099cb65bsi85702qvb.351.2024.01.08.07.22.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jan 2024 07:22:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-19756-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-19756-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-19756-linux.lists.archive=gmail.com@vger.kernel.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 1600D1C20C1D for ; Mon, 8 Jan 2024 15:22:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A856C5026C; Mon, 8 Jan 2024 15:22:37 +0000 (UTC) X-Original-To: linux-kernel@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 361C44C3AD; Mon, 8 Jan 2024 15:22:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BFEB3C433C8; Mon, 8 Jan 2024 15:22:35 +0000 (UTC) Date: Mon, 8 Jan 2024 10:23:31 -0500 From: Steven Rostedt To: Christian Brauner Cc: LKML , Linux Trace Kernel , Masami Hiramatsu , Mathieu Desnoyers , Linus Torvalds , Al Viro , linux-fsdevel@vger.kernel.org, Greg Kroah-Hartman Subject: Re: [PATCH] tracefs/eventfs: Use root and instance inodes as default ownership Message-ID: <20240108102331.7de98cab@gandalf.local.home> In-Reply-To: <20240108-ortsrand-ziehen-4e9a9a58e708@brauner> References: <20240103203246.115732ec@gandalf.local.home> <20240105-wegstecken-sachkenntnis-6289842d6d01@brauner> <20240105095954.67de63c2@gandalf.local.home> <20240107-getrickst-angeeignet-049cea8cad13@brauner> <20240107132912.71b109d8@rorschach.local.home> <20240108-ortsrand-ziehen-4e9a9a58e708@brauner> X-Mailer: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Mon, 8 Jan 2024 12:04:54 +0100 Christian Brauner wrote: > > > IOW, the inode_permission() in lookup_one_len() that eventfs does is > > > redundant and just wrong. > > > > I don't think so. > > I'm very well aware that the dentries and inode aren't created during > mkdir but the completely directory layout is determined. You're just > splicing in dentries and inodes during lookup and readdir. > > If mkdir /sys/kernel/tracing/instances/foo has succeeded and you later > do a lookup/readdir on > > ls -al /sys/kernel/tracing/instances/foo/events > > Why should the creation of the dentries and inodes ever fail due to a > permission failure? They shouldn't. > The vfs did already verify that you had the required > permissions to list entries in that directory. Why should filling up > /sys/kernel/tracing/instances/foo/events ever fail then? It shouldn't > That tracefs instance would be half-functional. And again, right now > that inode_permission() check cannot even fail. And it shouldn't. But without dentries and inodes, how does VFS know what is allowed to open the files? -- Steve