[c2] Kernel debugfs not readable by non-root

REPRODUCIBILITY: 100% (always)
OSVERSION: 5.0.0.29
HARDWARE: Reeder S19 Max Pro S - s19mps - s19mps - 1.0.0.22 - aarch64
UI LANGUAGE: English (UK) (user: en_GB, os: en_GB.utf8)
REGRESSION: yes (since: 4.4.0.72 - aarch64)

DESCRIPTION:

Now, this may actually be notabug/an improvement/by design re. security, but it is an regression and it breaks some monitoring tools.

PRECONDITIONS:

None?

STEPS TO REPRODUCE:

Here’s one way, but you can see it without collectd:

  1. install collectd
  2. start the service
  3. monitor the service output with systemctl --user status -l collectd

EXPECTED RESULTS:

It’s actually not unexpected, but on XPeria10iii, debufgfs is mounted as:

nemo@PGXperiiia10:~ $ ls -l /sys/kernel/debug -add
drwxr-xr-x   96 root     root             0 Nov 20 05:00 /sys/kernel/debug/

while on the C2 it’s

nemo@PGJollaC2:~ $ ls -l  /sys/kernel/debug -ad
drwx------   96 root     root             0 Jan  1  1970 /sys/kernel/debug/

ACTUAL RESULTS:

Some plugins of collectd rely on debugfs files to be accessible:

Nov 20 08:01:18 PGJollaC2 systemd[2369]: Started Collectd statistics daemon.
Nov 20 08:01:18 PGJollaC2 collectd[48157]: [2024-11-20 08:01:18] radio plugin: Found 3 radios
Nov 20 08:01:18 PGJollaC2 collectd[48157]: [2024-11-20 08:01:18] suspend plugin: cannot read /sys/kernel/debug/suspend_stats,
unregistered plugin
Nov 20 08:01:18 PGJollaC2 collectd[48157]: [2024-11-20 08:01:18] Initialization complete, entering read-loop.
Nov 20 08:01:18 PGJollaC2 collectd[48157]: [2024-11-20 08:01:18] radio: cannot read value from /sys/class/rfkill/rfkill0/type
Nov 20 08:01:18 PGJollaC2 collectd[48157]: [2024-11-20 08:01:18] read-function of plugin `radio' failed. Will suspend it for 3
00.000 seconds.

MODIFICATIONS:

  • Patchmanager: yes
  • OpenRepos: yes
  • Chum: yes
  • Other: none specified

ADDITIONAL INFORMATION:

Device Owner User: nemo
Home Encryption: enabled

mandatory: xkcd: Workflow

the initial version of this bug report was created using Bugger 0.9.11+git2
2 Likes