All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH resend] sched: Fix sd->*_idx limit range avoiding overflow
@ 2013-04-08  6:39 libin
  2013-04-08 15:28 ` [tip:sched/urgent] sched/debug: Fix sd-> *_idx " tip-bot for libin
  0 siblings, 1 reply; 2+ messages in thread
From: libin @ 2013-04-08  6:39 UTC (permalink / raw)
  To: Ingo Molnar, Peter Zijlstra; +Cc: linux-kernel, jiang.liu, guohanjun

Commit 201c373e8e ("sched/debug: Limit sd->*_idx range on sysctl")
was an incomplete bug fix. This patch fixs sd->*_idx limit range to
[0 ~ CPU_LOAD_IDX_MAX - 1] avioding array overflow caused by setting
sd->*_idx to CPU_LOAD_IDX_MAX on sysctl.

Signed-off-by: Libin <huawei.libin@huawei.com>
---
 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 7f12624..ba89ada 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -4999,7 +4999,7 @@ static void sd_free_ctl_entry(struct ctl_table **tablep)
 }

 static int min_load_idx = 0;
-static int max_load_idx = CPU_LOAD_IDX_MAX;
+static int max_load_idx = CPU_LOAD_IDX_MAX - 1;

 static void
 set_table_entry(struct ctl_table *entry,
-- 1.6.0.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [tip:sched/urgent] sched/debug: Fix sd-> *_idx limit range avoiding overflow
  2013-04-08  6:39 [PATCH resend] sched: Fix sd->*_idx limit range avoiding overflow libin
@ 2013-04-08 15:28 ` tip-bot for libin
  0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for libin @ 2013-04-08 15:28 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, huawei.libin, peterz, tglx, jiang.liu,
	guohanjun

Commit-ID:  fd9b86d37a600488dbd80fe60cca46b822bff1cd
Gitweb:     http://git.kernel.org/tip/fd9b86d37a600488dbd80fe60cca46b822bff1cd
Author:     libin <huawei.libin@huawei.com>
AuthorDate: Mon, 8 Apr 2013 14:39:12 +0800
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Mon, 8 Apr 2013 13:23:03 +0200

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>
---
 kernel/sched/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 306943f..fa07792 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)
 }
 
 static int min_load_idx = 0;
-static int max_load_idx = CPU_LOAD_IDX_MAX;
+static int max_load_idx = CPU_LOAD_IDX_MAX-1;
 
 static void
 set_table_entry(struct ctl_table *entry,

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-04-08 15:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-08  6:39 [PATCH resend] sched: Fix sd->*_idx limit range avoiding overflow libin
2013-04-08 15:28 ` [tip:sched/urgent] sched/debug: Fix sd-> *_idx " tip-bot for libin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.