diff options
author | libin <huawei.libin@huawei.com> | 2013-04-08 02:39:12 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2013-04-08 07:23:03 -0400 |
commit | fd9b86d37a600488dbd80fe60cca46b822bff1cd (patch) | |
tree | 4ce6afb8ec12c2d411546a8c70aeeb73c20e8e53 /kernel | |
parent | a1cbcaa9ea87b87a96b9fc465951dcf36e459ca2 (diff) |
sched/debug: Fix sd->*_idx limit range avoiding overflow
Commit 201c373e8e ("sched/debug: Limit sd->*_idx range on
sysctl") was an incomplete bug fix.
This patch fixes sd->*_idx limit range to [0 ~ CPU_LOAD_IDX_MAX-1]
avoiding array overflow caused by setting sd->*_idx to CPU_LOAD_IDX_MAX
on sysctl.
Signed-off-by: Libin <huawei.libin@huawei.com>
Cc: <jiang.liu@huawei.com>
Cc: <guohanjun@huawei.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/51626610.2040607@huawei.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/sched/core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 306943f531a3..fa077929e315 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c | |||
@@ -4933,7 +4933,7 @@ static void sd_free_ctl_entry(struct ctl_table **tablep) | |||
4933 | } | 4933 | } |
4934 | 4934 | ||
4935 | static int min_load_idx = 0; | 4935 | static int min_load_idx = 0; |
4936 | static int max_load_idx = CPU_LOAD_IDX_MAX; | 4936 | static int max_load_idx = CPU_LOAD_IDX_MAX-1; |
4937 | 4937 | ||
4938 | static void | 4938 | static void |
4939 | set_table_entry(struct ctl_table *entry, | 4939 | set_table_entry(struct ctl_table *entry, |