From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D211FC38145 for ; Thu, 8 Sep 2022 01:25:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229696AbiIHBZH (ORCPT ); Wed, 7 Sep 2022 21:25:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52010 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229500AbiIHBZF (ORCPT ); Wed, 7 Sep 2022 21:25:05 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C26C5A2859 for ; Wed, 7 Sep 2022 18:25:03 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6781C61AFE for ; Thu, 8 Sep 2022 01:25:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 263FBC433D6; Thu, 8 Sep 2022 01:25:02 +0000 (UTC) Date: Wed, 7 Sep 2022 21:25:42 -0400 From: Steven Rostedt To: Brian Norris Cc: Greg Kroah-Hartman , "Rafael J . Wysocki" , Ingo Molnar , linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] tracefs: Only clobber mode/uid/gid on remount if asked Message-ID: <20220907212542.513afad2@gandalf.local.home> In-Reply-To: References: <20220826174353.1.Icbd40fce59f55ad74b80e5d435ea233579348a78@changeid> <20220826174353.2.Iab6e5ea57963d6deca5311b27fb7226790d44406@changeid> <20220907074443.3376c766@gandalf.local.home> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 7 Sep 2022 13:52:15 -0700 Brian Norris wrote: > Existing behavior: > > ## Pre-existing status: tracefs is 0755. > # stat -c '%A' /sys/kernel/tracing/ > drwxr-xr-x > > ## (Re)trigger the automount. > # umount /sys/kernel/debug/tracing > # stat -c '%A' /sys/kernel/debug/tracing/. > drwx------ > > ## Unexpected: the automount changed mode for other mount instances. > # stat -c '%A' /sys/kernel/tracing/ > drwx------ > > New behavior: > > ## Pre-existing status: tracefs is 0755. > # stat -c '%A' /sys/kernel/tracing/ > drwxr-xr-x > > ## (Re)trigger the automount. > # umount /sys/kernel/debug/tracing > # stat -c '%A' /sys/kernel/debug/tracing/. > drwxr-xr-x > > ## Expected: the automount does not change other mount instances. > # stat -c '%A' /sys/kernel/tracing/ > drwxr-xr-x Thanks! Here's the new change log: -- Steve From: Brian Norris Subject: [PATCH] tracefs: Only clobber mode/uid/gid on remount if asked Users may have explicitly configured their tracefs permissions; we shouldn't overwrite those just because a second mount appeared. Only clobber if the options were provided at mount time. Note: the previous behavior was especially surprising in the presence of automounted /sys/kernel/debug/tracing/. Existing behavior: ## Pre-existing status: tracefs is 0755. # stat -c '%A' /sys/kernel/tracing/ drwxr-xr-x ## (Re)trigger the automount. # umount /sys/kernel/debug/tracing # stat -c '%A' /sys/kernel/debug/tracing/. drwx------ ## Unexpected: the automount changed mode for other mount instances. # stat -c '%A' /sys/kernel/tracing/ drwx------ New behavior (after this change): ## Pre-existing status: tracefs is 0755. # stat -c '%A' /sys/kernel/tracing/ drwxr-xr-x ## (Re)trigger the automount. # umount /sys/kernel/debug/tracing # stat -c '%A' /sys/kernel/debug/tracing/. drwxr-xr-x ## Expected: the automount does not change other mount instances. # stat -c '%A' /sys/kernel/tracing/ drwxr-xr-x Signed-off-by: Brian Norris