aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2007-08-23 09:18:02 -0400
committerIngo Molnar <mingo@elte.hu>2007-08-23 09:18:02 -0400
commitc57baf1e1e24b004b57d282267542baab802753c (patch)
tree3348374473c2f76abcb57d0785ccd1a2d21ea6a8
parent2aa44d0567ed21b47b87d68819415d48194cb923 (diff)
sched: fix sysctl directory permissions
There are two remaining gotchas: - The directories have impossible permissions (writeable). - The ctl_name for the kernel directory is inconsistent with everything else. It should be CTL_KERN. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--kernel/sched.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index 48e7586168ef..5fecbbba12ac 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -5257,15 +5257,16 @@ static void migrate_dead_tasks(unsigned int dead_cpu)
5257static struct ctl_table sd_ctl_dir[] = { 5257static struct ctl_table sd_ctl_dir[] = {
5258 { 5258 {
5259 .procname = "sched_domain", 5259 .procname = "sched_domain",
5260 .mode = 0755, 5260 .mode = 0555,
5261 }, 5261 },
5262 {0,}, 5262 {0,},
5263}; 5263};
5264 5264
5265static struct ctl_table sd_ctl_root[] = { 5265static struct ctl_table sd_ctl_root[] = {
5266 { 5266 {
5267 .ctl_name = CTL_KERN,
5267 .procname = "kernel", 5268 .procname = "kernel",
5268 .mode = 0755, 5269 .mode = 0555,
5269 .child = sd_ctl_dir, 5270 .child = sd_ctl_dir,
5270 }, 5271 },
5271 {0,}, 5272 {0,},
@@ -5341,7 +5342,7 @@ static ctl_table *sd_alloc_ctl_cpu_table(int cpu)
5341 for_each_domain(cpu, sd) { 5342 for_each_domain(cpu, sd) {
5342 snprintf(buf, 32, "domain%d", i); 5343 snprintf(buf, 32, "domain%d", i);
5343 entry->procname = kstrdup(buf, GFP_KERNEL); 5344 entry->procname = kstrdup(buf, GFP_KERNEL);
5344 entry->mode = 0755; 5345 entry->mode = 0555;
5345 entry->child = sd_alloc_ctl_domain_table(sd); 5346 entry->child = sd_alloc_ctl_domain_table(sd);
5346 entry++; 5347 entry++;
5347 i++; 5348 i++;
@@ -5361,7 +5362,7 @@ static void init_sched_domain_sysctl(void)
5361 for (i = 0; i < cpu_num; i++, entry++) { 5362 for (i = 0; i < cpu_num; i++, entry++) {
5362 snprintf(buf, 32, "cpu%d", i); 5363 snprintf(buf, 32, "cpu%d", i);
5363 entry->procname = kstrdup(buf, GFP_KERNEL); 5364 entry->procname = kstrdup(buf, GFP_KERNEL);
5364 entry->mode = 0755; 5365 entry->mode = 0555;
5365 entry->child = sd_alloc_ctl_cpu_table(i); 5366 entry->child = sd_alloc_ctl_cpu_table(i);
5366 } 5367 }
5367 sd_sysctl_header = register_sysctl_table(sd_ctl_root); 5368 sd_sysctl_header = register_sysctl_table(sd_ctl_root);