lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Wed, 13 Jul 2016 01:02:21 -0700
From:	tip-bot for Thomas Gleixner <tipbot@...or.com>
To:	linux-tip-commits@...r.kernel.org
Cc:	acme@...hat.com, peterz@...radead.org, tglx@...utronix.de,
	mingo@...nel.org, linux-kernel@...r.kernel.org,
	anna-maria@...utronix.de, kilobyte@...band.pl, kan.liang@...el.com,
	vincent.weaver@...ne.edu, torvalds@...ux-foundation.org,
	jolsa@...hat.com, xiaolong.ye@...el.com, eranian@...gle.com,
	bigeasy@...utronix.de, acme@...nel.org, bp@...e.de, hpa@...or.com,
	alexander.shishkin@...ux.intel.com
Subject: [tip:core/urgent] cpu/hotplug: Keep enough storage space if SMP=n
 to avoid array out of bounds scribble

Commit-ID:  a7c734140aa36413944eef0f8c660e0e2256357d
Gitweb:     http://git.kernel.org/tip/a7c734140aa36413944eef0f8c660e0e2256357d
Author:     Thomas Gleixner <tglx@...utronix.de>
AuthorDate: Tue, 12 Jul 2016 21:59:23 +0200
Committer:  Ingo Molnar <mingo@...nel.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@...el.com>
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Cc: Adam Borowski <kilobyte@...band.pl>
Cc: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
Cc: Anna-Maria Gleixner <anna-maria@...utronix.de>
Cc: Arnaldo Carvalho de Melo <acme@...nel.org>
Cc: Arnaldo Carvalho de Melo <acme@...hat.com>
Cc: Borislav Petkov <bp@...e.de>
Cc: Jiri Olsa <jolsa@...hat.com>
Cc: Kan Liang <kan.liang@...el.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Cc: Stephane Eranian <eranian@...gle.com>
Cc: Vince Weaver <vincent.weaver@...ne.edu>
Cc: lkp@...org
Cc: stable@...r.kernel.org
Cc: tipbuild@...or.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@...nel.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
 };
 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ