lkml.org 
[lkml]   [2022]   [Sep]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] tracefs: Only clobber mode/uid/gid on remount if asked
On Wed, 7 Sep 2022 13:52:15 -0700
Brian Norris <briannorris@chromium.org> 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 <briannorris@chromium.org>
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 <briannorris@chromium.org>

\
 
 \ /
  Last update: 2022-09-08 03:26    [W:0.046 / U:2.248 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site