From: Steven Rostedt <rostedt@goodmis.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Brian Norris <briannorris@chromium.org>,
"Rafael J . Wysocki" <rafael@kernel.org>,
Ingo Molnar <mingo@redhat.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] debugfs: Only clobber mode/uid/gid on remount if asked
Date: Thu, 1 Sep 2022 12:11:09 -0400 [thread overview]
Message-ID: <20220901121109.2a71d779@gandalf.local.home> (raw)
In-Reply-To: <YxDWlgulBijTzj3y@kroah.com>
On Thu, 1 Sep 2022 17:58:14 +0200
Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
> On Fri, Aug 26, 2022 at 05:44:16PM -0700, Brian Norris wrote:
> > Users may have explicitly configured their debugfs permissions; we
> > shouldn't overwrite those just because a second mount appeared.
>
> What userspace mounts debugfs twice?
>
> > Only clobber if the options were provided at mount time.
> >
> > # Don't change /sys/kernel/debug/ permissions.
> > mount -t debugfs none /mnt/foo
> >
> > # Change /sys/kernel/debug/ mode and uid, but not gid.
> > mount -t debugfs -o uid=bar,mode=0750 none /mnt/baz
>
> So what happens today with this change? Without it?
>
> >
> > Signed-off-by: Brian Norris <briannorris@chromium.org>
> > ---
> > I'm open to writing an LTP test case for this, if that seems like a good
> > idea.
>
> If it's really needed, again, why would debugfs be ever mounted more
> than once?
>
The real issue is with tracefs, and I think the debugfs patch is just for
consistency. But I (and others) do have debugfs mounted more that once. ;-)
# mount |grep debugfs
debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
debugfs on /debug type debugfs (rw,relatime)
I added /debug (and I know others that just add /d) for shortcuts to get to
the debugfs directory easier.
This patch series came about because ideally tracefs should be mounted in
/sys/kernel/tracing. But because a lot of scripts use the old path of
/sys/kernel/debug/tracing, I have tracefs mounted there automatically
when debugfs is mounted. This is so that scripts do not break.
I would love to deprecate the /sys/kernel/debug/tracing automatic mounting,
but I do not know what user space will break if that happens. libtracefs
handles finding where tracefs is, so anything that uses that is fine.
But anyway, because tracefs is mounted more than once, if someone has
tracefs mounted in the correct location "/sys/kernel/tracing" and updates
the permissions to the files, but then mounts debugfs, due to the automatic
mounting, all their changes go away.
Perhaps we only need the second patch because of the automatic mounting.
Maybe people do not care if things get reset if they manually mount debugfs
more than once. I (and others) have it in my fstab, so it's done at boot up
and any changes should affect both.
-- Steve
next prev parent reply other threads:[~2022-09-01 16:10 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-27 0:44 Brian Norris
2022-08-27 0:44 ` [PATCH 2/2] tracefs: " Brian Norris
2022-09-07 11:44 ` Steven Rostedt
2022-09-07 20:52 ` Brian Norris
2022-09-08 1:25 ` Steven Rostedt
2022-09-07 21:46 ` Steven Rostedt
2022-09-07 21:48 ` Steven Rostedt
2022-09-07 21:53 ` Brian Norris
2022-09-07 22:45 ` Steven Rostedt
2022-09-01 15:58 ` [PATCH 1/2] debugfs: " Greg Kroah-Hartman
2022-09-01 16:11 ` Steven Rostedt [this message]
2022-09-01 22:32 ` Brian Norris
2022-09-02 5:45 ` Greg Kroah-Hartman
2022-09-09 0:16 ` Brian Norris
2022-09-09 0:43 ` Steven Rostedt
2022-09-09 0:57 ` Brian Norris
2022-09-09 1:05 ` Steven Rostedt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220901121109.2a71d779@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=briannorris@chromium.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=rafael@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®