From: Ulrich Drepper Date: Tue, 31 Jul 2007 07:38:16 +0000 (-0700) Subject: CPU online file permission X-Git-Tag: v2.6.23-rc2~101 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=9eb3ff40376e505eafb927b4a4cbccc928df68ec;p=linux-2.6-omap-h63xx.git 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: Ulrich Drepper Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c index fe7ef339414..40545071e3c 100644 --- a/drivers/base/cpu.c +++ b/drivers/base/cpu.c @@ -53,7 +53,7 @@ static ssize_t store_online(struct sys_device *dev, const char *buf, ret = count; 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) {