Commit 9eb3ff40 authored by Ulrich Drepper's avatar Ulrich Drepper Committed by Linus Torvalds

CPU online file permission

Is there a reason why the "online" file in the subdirectories for the CPUs
in /sys/devices/system isn't world-readable?  I cannot imagine it to be
security relevant especially now that a getcpu() syscall can be used to
determine what CPUa thread runs on.

The file is useful to correctly implement the sysconf() function to return
the number of online CPUs.  In the presence of hotplug we currently cannot
provide this information.  The patch below should to it.
Signed-off-by: default avatarUlrich Drepper <drepper@redhat.com>
Cc: <stable@kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 07a30460
...@@ -53,7 +53,7 @@ static ssize_t store_online(struct sys_device *dev, const char *buf, ...@@ -53,7 +53,7 @@ static ssize_t store_online(struct sys_device *dev, const char *buf,
ret = count; ret = count;
return ret; return ret;
} }
static SYSDEV_ATTR(online, 0600, show_online, store_online); static SYSDEV_ATTR(online, 0644, show_online, store_online);
static void __devinit register_cpu_control(struct cpu *cpu) static void __devinit register_cpu_control(struct cpu *cpu)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment