Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp2325325rdd; Fri, 12 Jan 2024 06:23:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IGS3VTWZwAUh5P1E6rieIFSbNuBNSCf7hHrZ9CkQCv0XyZOeCL7SyJC881mliqtDVhzCv2+ X-Received: by 2002:aa7:de0f:0:b0:558:b975:1ff3 with SMTP id h15-20020aa7de0f000000b00558b9751ff3mr1667194edv.6.1705069383815; Fri, 12 Jan 2024 06:23:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705069383; cv=none; d=google.com; s=arc-20160816; b=bU4JYj9ohoC+Rg+TggW4CCdZgWUOW05YD32CaSNulMmN3iGRr8kXinq8ijvHvJnF5+ D6aS+cmY0QMGzwAo31gYCbkBtRhYuabvBfEsvjQ3MU1dK0pVK/5Irh4HxF/FvSV6fYOi vxLiUs/lR2btXOykKsg8rRGmyMFk1pLAO12/t4R75P1DI+3Pha8m/Ud+RSOq9lOoZQDe 0woNo3dv3bguXWY8hbkJaY8QmUmJ+KhtLmFXPhkQ/gwb/9FSQN0bFVb+0pSoHSlsVwDW mIa8HJz6bz6OuIhwZdFmTTNLUEK2kOEZTJ9pSB9pG9ZlvE24mlP7gie+KJWGSuu2Jlpx mxIA== 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=lXVI+4ah40B12imtukK6YxskVY8eiYAgEbtbt/wr46A=; fh=d0Ct0J+JiGzn8473V3+2DIY7dSmzIWejAPUIcKsWBu0=; b=ccINXU/bjtTlZOtHIXlc2RS/Zbkxc8NW/JOGncsUDdiL7AZzADI8Dkh2KJqO657sOn zEchPRqNQSdvu4iebu/jhhATnBcbka/BEBXRUrRb6yb0uS8+dQ/MFq2QiC7BFueowcmA JStYWsYLmXJfvhr1zs+CzjMPIIdkUqhM2GfeRRh6j6OQRD0yw1lDYRjbSCMjJFyMy1iS fOceGk6V1DSW4B0vZFEMezNTZYGKldW7/7tErJ+Std5b7UtpqKavE9Uienr6XFkhqIo1 CBl3lMQKw2w/+fM3i/9nMtZKxFHfx3K0A5saz/QANYG62a6sahzIE2mkkphdt+zfmxOH 6tLQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-24733-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24733-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id dm13-20020a05640222cd00b0054c652bd5a9si1421259edb.440.2024.01.12.06.23.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jan 2024 06:23:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-24733-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-24733-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24733-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 8F33B1F23CBA for ; Fri, 12 Jan 2024 14:23:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CEDED6DD16; Fri, 12 Jan 2024 14:22:35 +0000 (UTC) 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 5A96E6DD01; Fri, 12 Jan 2024 14:22:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6D5A3C433C7; Fri, 12 Jan 2024 14:22:33 +0000 (UTC) Date: Fri, 12 Jan 2024 09:22:30 -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: <20240112092230.6107bc94@rorschach.local.home> In-Reply-To: <20240112085344.30540d10@rorschach.local.home> References: <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> <20240108102331.7de98cab@gandalf.local.home> <20240110-murren-extra-cd1241aae470@brauner> <20240110080746.50f7767d@gandalf.local.home> <20240111-unzahl-gefegt-433acb8a841d@brauner> <20240111165319.4bb2af76@gandalf.local.home> <20240112-normierung-knipsen-dccb7cac7efc@brauner> <20240112085344.30540d10@rorschach.local.home> X-Mailer: Claws Mail 3.17.8 (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 Fri, 12 Jan 2024 08:53:44 -0500 Steven Rostedt wrote: > > // We managed to open the directory so we have permission to list > > // directory entries in "xfs". > > fd = open("/sys/kernel/tracing/events/xfs"); > > > > // Remove ownership so we can't open the directory anymore > > chown("/sys/kernel/tracing/events/xfs", 0, 0); > > > > // Or just remove exec bit for the group and restrict to owner > > chmod("/sys/kernel/tracing/events/xfs", 700); > > > > // Drop caches to force an eventfs_root_lookup() on everything > > write("/proc/sys/vm/drop_caches", "3", 1); > > This requires opening the directory, then having it's permissions > change, and then immediately dropping the caches. > > > > > // Returns 0 even though directory has a lot of entries and we should be > > // able to list them > > getdents64(fd, ...); > > And do we care? Hmm, maybe the issue you have is with the inconsistency of the action? For this to fail, it would require the admin to do both change the permission and to flush caches. If you don't flush the caches then the task with the dir open can still read it regardless. If the dentries were already created. In that case I'm fine if we change the creation of the dentries to not check the permission. But for now, it's just a weird side effect that I don't really see how it would affect any user's workflow. -- Steve