From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752551AbcGMIEh (ORCPT ); Wed, 13 Jul 2016 04:04:37 -0400 Received: from terminus.zytor.com ([198.137.202.10]:43512 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751278AbcGMIEZ (ORCPT ); Wed, 13 Jul 2016 04:04:25 -0400 Date: Wed, 13 Jul 2016 01:02:21 -0700 From: tip-bot for Thomas Gleixner Message-ID: 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 Reply-To: acme@kernel.org, bigeasy@linutronix.de, vincent.weaver@maine.edu, kan.liang@intel.com, torvalds@linux-foundation.org, jolsa@redhat.com, eranian@google.com, xiaolong.ye@intel.com, alexander.shishkin@linux.intel.com, bp@suse.de, hpa@zytor.com, linux-kernel@vger.kernel.org, mingo@kernel.org, acme@redhat.com, tglx@linutronix.de, peterz@infradead.org, kilobyte@angband.pl, anna-maria@linutronix.de In-Reply-To: References: To: linux-tip-commits@vger.kernel.org Subject: [tip:core/urgent] cpu/hotplug: Keep enough storage space if SMP=n to avoid array out of bounds scribble Git-Commit-ID: a7c734140aa36413944eef0f8c660e0e2256357d X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: a7c734140aa36413944eef0f8c660e0e2256357d Gitweb: http://git.kernel.org/tip/a7c734140aa36413944eef0f8c660e0e2256357d Author: Thomas Gleixner AuthorDate: Tue, 12 Jul 2016 21:59:23 +0200 Committer: Ingo Molnar 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 Signed-off-by: Thomas Gleixner Cc: Adam Borowski Cc: Alexander Shishkin Cc: Anna-Maria Gleixner Cc: Arnaldo Carvalho de Melo Cc: Arnaldo Carvalho de Melo Cc: Borislav Petkov Cc: Jiri Olsa Cc: Kan Liang Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Sebastian Andrzej Siewior Cc: Stephane Eranian Cc: Vince Weaver 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 --- 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 };