From: tip-bot for Thomas Gleixner <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: acme@redhat.com, peterz@infradead.org, tglx@linutronix.de,
mingo@kernel.org, linux-kernel@vger.kernel.org,
anna-maria@linutronix.de, kilobyte@angband.pl,
kan.liang@intel.com, vincent.weaver@maine.edu,
torvalds@linux-foundation.org, jolsa@redhat.com,
xiaolong.ye@intel.com, eranian@google.com, bigeasy@linutronix.de,
acme@kernel.org, bp@suse.de, hpa@zytor.com,
alexander.shishkin@linux.intel.com
Subject: [tip:core/urgent] cpu/hotplug: Keep enough storage space if SMP=n to avoid array out of bounds scribble
Date: Wed, 13 Jul 2016 01:02:21 -0700 [thread overview]
Message-ID: <tip-a7c734140aa36413944eef0f8c660e0e2256357d@git.kernel.org> (raw)
In-Reply-To: <alpine.DEB.2.11.1607122144560.4083@nanos>
Commit-ID: a7c734140aa36413944eef0f8c660e0e2256357d
Gitweb: http://git.kernel.org/tip/a7c734140aa36413944eef0f8c660e0e2256357d
Author: Thomas Gleixner <tglx@linutronix.de>
AuthorDate: Tue, 12 Jul 2016 21:59:23 +0200
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Wed, 13 Jul 2016 09:29:39 +0200
cpu/hotplug: Keep enough storage space if SMP=n to avoid array out of bounds scribble
Xiaolong Ye reported lock debug warnings triggered by the following commit:
8de4a0066106 ("perf/x86: Convert the core to the hotplug state machine")
The bug is the following: the cpuhp_bp_states[] array is cut short when
CONFIG_SMP=n, but the dynamically registered callbacks are stored nevertheless
and happily scribble outside of the array bounds...
We need to store them in case that the state is unregistered so we can invoke
the teardown function. That's independent of CONFIG_SMP. Make sure the array
is large enough.
Reported-by: kernel test robot <xiaolong.ye@intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Adam Borowski <kilobyte@angband.pl>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Anna-Maria Gleixner <anna-maria@linutronix.de>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Kan Liang <kan.liang@intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Stephane Eranian <eranian@google.com>
Cc: Vince Weaver <vincent.weaver@maine.edu>
Cc: lkp@01.org
Cc: stable@vger.kernel.org
Cc: tipbuild@zytor.com
Fixes: cff7d378d3fd "cpu/hotplug: Convert to a state machine for the control processor"
Link: http://lkml.kernel.org/r/alpine.DEB.2.11.1607122144560.4083@nanos
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
kernel/cpu.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/kernel/cpu.c b/kernel/cpu.c
index d948e44..7b61887 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -1201,6 +1201,8 @@ static struct cpuhp_step cpuhp_bp_states[] = {
.teardown = takedown_cpu,
.cant_stop = true,
},
+#else
+ [CPUHP_BRINGUP_CPU] = { },
#endif
};
prev parent reply other threads:[~2016-07-13 8:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <57851c63.jJgXfR29tgQSoJ3w%xiaolong.ye@intel.com>
2016-07-12 16:41 ` [perf/x86] 8de4a00661: WARNING: CPU: 0 PID: 1 at kernel/locking/mutex-debug.c:80 debug_mutex_unlock+0x20c/0x2b3 Thomas Gleixner
2016-07-12 17:19 ` Thomas Gleixner
2016-07-12 19:59 ` Thomas Gleixner
2016-07-13 8:02 ` tip-bot for Thomas Gleixner [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-a7c734140aa36413944eef0f8c660e0e2256357d@git.kernel.org \
--to=tipbot@zytor.com \
--cc=acme@kernel.org \
--cc=acme@redhat.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=anna-maria@linutronix.de \
--cc=bigeasy@linutronix.de \
--cc=bp@suse.de \
--cc=eranian@google.com \
--cc=hpa@zytor.com \
--cc=jolsa@redhat.com \
--cc=kan.liang@intel.com \
--cc=kilobyte@angband.pl \
--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 \
--cc=torvalds@linux-foundation.org \
--cc=vincent.weaver@maine.edu \
--cc=xiaolong.ye@intel.com \
/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
Powered by JetHome