Re: [GIT PULL] cputime patch for 2.6.30-rc6

Jan Engelhardt
2009-05-19T13:32:50Z

On Monday 2009-05-18 17:24, Peter Zijlstra wrote:
>> + for_each_possible_cpu(i)
>> + idletime = cputime64_add(idletime, kstat_cpu(i).cpustat.idle);
>> + idletime = cputime64_to_clock_t(idletime);
>>
>> do_posix_clock_monotonic_gettime(&uptime);
>> monotonic_to_bootbased(&uptime);
>
>This is a world readable proc file, adding a for_each_possible_cpu() in
>there scares me a little (this wouldn't be the first and only such case
>though).

Well maybe procfs could gain chmod support (with the same lifetime
guarantee that one would have with tmpfs), so that init scripts of
big boxes can chmod it 400 on boot if there is that potential user
threat:

>Then think about userspace doing:
> while :; do cat /proc/uptime > /dev/null; done