Re: bizarre 2.6.8.1 /sys permissions

From: Dave Jones
Date: Wed Aug 25 2004 - 17:27:16 EST


On Wed, Aug 25, 2004 at 01:25:12PM -0700, Dan Hollis wrote:


> Do these file permissions make sense to anyone?

Yes.

> $ cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq
> cat: /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq: Permission denied

Reading this file causes reads from hardware on some cpufreq drivers.
This can be a slow operation, so a user could degrade system performance
for everyone else by repeatedly cat'ing it.

> $ cat /proc/cpuinfo
> processor : 0
> vendor_id : GenuineIntel
> cpu family : 15
> model : 2
> model name : Intel(R) Celeron(R) CPU 2.60GHz
> stepping : 9
> cpu MHz : 324.528

This is read from the cpu_khz variable, so isn't affected by
this problem.

> $ ls -la /sys/devices/system/cpu/cpu0/cpufreq/
> total 0
> drwxr-xr-x 2 root root 0 Aug 23 13:06 .
> drwxr-xr-x 3 root root 0 Aug 23 13:06 ..
> -r-------- 1 root root 4096 Aug 23 13:06 cpuinfo_cur_freq
> -r--r--r-- 1 root root 4096 Aug 23 13:06 cpuinfo_max_freq
> -r--r--r-- 1 root root 4096 Aug 23 13:06 cpuinfo_min_freq
> -r--r--r-- 1 root root 4096 Aug 23 13:06 scaling_available_frequencies
> -r--r--r-- 1 root root 4096 Aug 23 13:06 scaling_available_governors
> -r--r--r-- 1 root root 4096 Aug 23 13:06 scaling_cur_freq
> -r--r--r-- 1 root root 4096 Aug 23 13:06 scaling_driver
> -rw-r--r-- 1 root root 0 Aug 25 13:19 scaling_governor
> -rw-r--r-- 1 root root 4096 Aug 23 13:06 scaling_max_freq
> -rw-r--r-- 1 root root 4096 Aug 23 13:06 scaling_min_freq
> -rw-r--r-- 1 root root 0 Aug 25 13:19 scaling_setspeed

Looks fine to me.

Dave

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/