From mboxrd@z Thu Jan 1 00:00:00 1970 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 7054C30C37C; Thu, 9 Apr 2026 18:34:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775759642; cv=none; b=TXao/6n6dKIqPj4WGJKuw+CkXsshtE3I2go0LMEQDCNQBRLRQS4PnGPbRfa9sb5wI3DRLLraBHwLA9hqo9RrtUaBHaLsFVYITNfR1+CfJcndZUe4livm7tvO8q2WoWUVYJtH/fPbEIhYhBYHS15uVer1g30JlduOTpT4Gk2AP+I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775759642; c=relaxed/simple; bh=2x4T0Y1JzS1vzWskwMOMLHIuUdYKOC0Iw72au6ZCYps=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=BOAxWNqun5gMn1auryW79/ABHUeUqQRR1CKcF2R2KKlEOSIMyKuA8PKb+1uUjzKHFucQSEaKjePU4EDHMARsIN2sr/TAd+/HsakBaUzvJKeXqeSpu5TioDwwZp0qd26F9HDNGUtPBwf0QpO7CyZBFWeODZgGGJCUw16xODdjVwg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=tVhgjCly; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="tVhgjCly" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 52E91C4AF09; Thu, 9 Apr 2026 18:34:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775759642; bh=2x4T0Y1JzS1vzWskwMOMLHIuUdYKOC0Iw72au6ZCYps=; h=Date:From:To:Cc:Subject:References:From; b=tVhgjClyQ8rPbGQlYOp89rGlRuSe61MPprFnEZGzvj304nCJ4CmghYU0VkfQhzP8X 20JD3oTGUut+x7/WUJcx8b18mngxo+Jdllts4L42dWyxdOj9EQRzVw6tcDCQ9ED/5s ls1V6FMX3x5oAhvUmjFE1JqlpCmXXYYXS3hKvoahfnqI6EUEg8L1NLNb1wa9B9Bczr A4FKsNtiNuWwI1VANlH1gl43P7x9EjMIOP6rOfmr+YqcrNaIqZY4w31FA762FH6kc7 SlMwRACfzdW/EEjQYS65OQF8dY+WBYj6r6SWLcdOh5KqYKmfv15M5KXwRfh3jSujj6 MFydXXVxvINqg== Received: from rostedt by gandalf with local (Exim 4.99.1) (envelope-from ) id 1wAuDp-00000003pHF-27y7; Thu, 09 Apr 2026 14:35:21 -0400 Message-ID: <20260409183521.365349196@kernel.org> User-Agent: quilt/0.69 Date: Thu, 09 Apr 2026 14:35:00 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , stable@vger.kernel.org, David Carlier Subject: [for-next][PATCH 3/3] tracefs: Fix default permissions not being applied on initial mount References: <20260409183457.935983082@kernel.org> 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=UTF-8 From: David Carlier Commit e4d32142d1de ("tracing: Fix tracefs mount options") moved the option application from tracefs_fill_super() to tracefs_reconfigure() called from tracefs_get_tree(). This fixed mount options being ignored on user-space mounts when the superblock already exists, but introduced a regression for the initial kernel-internal mount. On the first mount (via simple_pin_fs during init), sget_fc() transfers fc->s_fs_info to sb->s_fs_info and sets fc->s_fs_info to NULL. When tracefs_get_tree() then calls tracefs_reconfigure(), it sees a NULL fc->s_fs_info and returns early without applying any options. The root inode keeps mode 0755 from simple_fill_super() instead of the intended TRACEFS_DEFAULT_MODE (0700). Furthermore, even on subsequent user-space mounts without an explicit mode= option, tracefs_apply_options(sb, true) gates the mode behind fsi->opts & BIT(Opt_mode), which is unset for the defaults. So the mode is never corrected unless the user explicitly passes mode=0700. Restore the tracefs_apply_options(sb, false) call in tracefs_fill_super() to apply default permissions on initial superblock creation, matching what debugfs does in debugfs_fill_super(). Cc: stable@vger.kernel.org Fixes: e4d32142d1de ("tracing: Fix tracefs mount options") Link: https://patch.msgid.link/20260404134747.98867-1-devnexen@gmail.com Signed-off-by: David Carlier Signed-off-by: Steven Rostedt (Google) --- fs/tracefs/inode.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/tracefs/inode.c b/fs/tracefs/inode.c index fa4c7e6aa5ff..5602baf980f6 100644 --- a/fs/tracefs/inode.c +++ b/fs/tracefs/inode.c @@ -468,6 +468,7 @@ static int tracefs_fill_super(struct super_block *sb, struct fs_context *fc) return err; sb->s_op = &tracefs_super_operations; + tracefs_apply_options(sb, false); set_default_d_op(sb, &tracefs_dentry_operations); return 0; -- 2.51.0