Ben Hutchings <b...@decadent.org.uk> writes:

> I would like to address this by backporting this feature:
>
> commit d6e486868cde585842d55ba3b6ec57af090fc343
> Author: Ludwig Nussel <ludwig.nus...@suse.de>
> Date:   Wed Jan 25 11:52:28 2012 +0100
>
>     debugfs: add mode, uid and gid options
>
> and then changing the default mode (mask) to be 0700. 

I like the proposal, but the feature does not seem mature yet.  Played a
bit with it and noticed a couple of confusing bugs which IMHO should be
fixed first:

 1) mode and owner is not propagated to files below the mount point:

nemi:/tmp# mount /sys/kernel/debug -o uid=42,mode=0700
nemi:/tmp# ls -la /sys/kernel/debug/
total 0
drwx------ 16   42 root 0 Jul  2 00:07 .
drwxr-xr-x  6 root root 0 Jul  2 00:07 ..
drwxr-xr-x  2 root root 0 Jul  2 00:07 acpi
drwxr-xr-x 32 root root 0 Jul 11 14:36 bdi
drwxr-xr-x  2 root root 0 Jul 13 11:51 bluetooth
drwxr-xr-x  4 root root 0 Jul  2 00:07 dri
drwxr-xr-x  2 root root 0 Jul  2 00:07 dynamic_debug
drwxr-xr-x  2 root root 0 Jul  2 00:07 extfrag
-r--r--r--  1 root root 0 Jul  2 00:07 gpio
drwxr-xr-x  3 root root 0 Jul  2 00:07 ieee80211
drwxr-xr-x  2 root root 0 Jul  2 00:07 kprobes
drwxr-xr-x  2 root root 0 Jul  2 00:07 kvm
drwxr-xr-x  2 root root 0 Jul  2 00:07 mce
drwxr-xr-x  2 root root 0 Jul  2 00:07 regmap
-rw-r--r--  1 root root 0 Jul  2 00:07 sched_features
-r--r--r--  1 root root 0 Jul  2 00:07 suspend_stats
drwxr-xr-x  5 root root 0 Jul  2 00:07 tracing
drwxr-xr-x  2 root root 0 Jul  2 00:07 usb
-r--r--r--  1 root root 0 Jul  2 00:07 wakeup_sources
drwxr-xr-x  2 root root 0 Jul  2 00:07 x86


 2) ownership and mode seems to be shared amoung all mount points,
    resulting in the following unexpected behaviour:

nemi:/tmp# mount /sys/kernel/debug -o uid=42,mode=0700
nemi:/tmp# ls -ld /sys/kernel/debug
drwx------ 16 42 root 0 Jul  2 00:07 /sys/kernel/debug
nemi:/tmp# mount -t debugfs none /mnt/temp -o uid=0,mode=0755
nemi:/tmp# ls -ld /sys/kernel/debug
drwxr-xr-x 16 root root 0 Jul  2 00:07 /sys/kernel/debug


 3) ownership (but not mode?!) seems to be cached between mounts,
    resulting in the following unexpected behaviour:

nemi:/tmp# mount /sys/kernel/debug -o uid=42,mode=0700
nemi:/tmp# ls -ld /sys/kernel/debug
drwx------ 16 42 root 0 Jul  2 00:07 /sys/kernel/debug
nemi:/tmp# umount /sys/kernel/debug
nemi:/tmp# grep debugfs /proc/mounts 
nemi:/tmp# grep debugfs /etc/fstab
debug   /sys/kernel/debug       debugfs defaults
nemi:/tmp# mount /sys/kernel/debug
nemi:/tmp# ls -ld /sys/kernel/debug
drwxr-xr-x 16 42 root 0 Jul  2 00:07 /sys/kernel/debug



These can all be considered minor glitches, but they sure confused me
the first time I hit them.



Bjørn



--
To UNSUBSCRIBE, email to debian-kernel-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/87d33zgbrs....@nemi.mork.no

Reply via email to