The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: tip-bot for libin <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@kernel.org,
	huawei.libin@huawei.com, peterz@infradead.org,
	tglx@linutronix.de, jiang.liu@huawei.com, guohanjun@huawei.com
Subject: [tip:sched/urgent] sched/debug: Fix sd-> *_idx limit range avoiding overflow
Date: Mon, 8 Apr 2013 08:28:13 -0700	[thread overview]
Message-ID: <tip-fd9b86d37a600488dbd80fe60cca46b822bff1cd@git.kernel.org> (raw)
In-Reply-To: <51626610.2040607@huawei.com>

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,

      reply	other threads:[~2013-04-08 15:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-fd9b86d37a600488dbd80fe60cca46b822bff1cd@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=guohanjun@huawei.com \
    --cc=hpa@zytor.com \
    --cc=huawei.libin@huawei.com \
    --cc=jiang.liu@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox