summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorRandy Dunlap <rddunlap@osdl.org>2005-01-04 05:32:43 -0800
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-01-04 05:32:43 -0800
commit920e33286e432fd1717cb9513cc91cd3a80ed12a (patch)
tree06fe44b87d24a7e971e4d3ab6cebe10af001a0e5 /kernel
parent68764ad9ef60d9308dcce419c9a9bfc7fcab2ac8 (diff)
[PATCH] cpumask: range check before using value
When setting the 'cpu_isolated_map' mask, check that the user input value is valid (in range 0 .. NR_CPUS - 1). Also fix up kernel-parameters.txt for this parameter. Signed-off-by: Randy Dunlap <rddunlap@osdl.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sched.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index 4c10b10c05c7..3386e7b87614 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -36,6 +36,7 @@
#include <linux/blkdev.h>
#include <linux/delay.h>
#include <linux/smp.h>
+#include <linux/threads.h>
#include <linux/timer.h>
#include <linux/rcupdate.h>
#include <linux/cpu.h>
@@ -4169,7 +4170,8 @@ static int __init isolated_cpu_setup(char *str)
str = get_options(str, ARRAY_SIZE(ints), ints);
cpus_clear(cpu_isolated_map);
for (i = 1; i <= ints[0]; i++)
- cpu_set(ints[i], cpu_isolated_map);
+ if (ints[i] < NR_CPUS)
+ cpu_set(ints[i], cpu_isolated_map);
return 1;
}