]> git.hungrycats.org Git - linux/commitdiff
[PATCH] CPU online file permission
authorUlrich Drepper <drepper@redhat.com>
Tue, 31 Jul 2007 07:38:16 +0000 (00:38 -0700)
committerWilly Tarreau <w@1wt.eu>
Sat, 25 Aug 2007 15:24:05 +0000 (17:24 +0200)
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 <drepper@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Willy Tarreau <w@1wt.eu>
drivers/base/cpu.c

index 7fd095efaebd75d3d6e1446b7bfdee12c64e31df..be31b43580599f304aa26cd242b1497152939a28 100644 (file)
@@ -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)
 {