mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v3 0/2] cpu/hotplug: Fix cpuhp_cpu_state used before init
@ 2022-04-11 15:22 Steven Price
  2022-04-11 15:22 ` [PATCH v3 1/2] cpu/hotplug: Remove the 'cpu' member of cpuhp_cpu_state Steven Price
  2022-04-11 15:22 ` [PATCH v3 2/2] cpu/hotplug: Initialise all cpuhp_cpu_state structs earlier Steven Price
  0 siblings, 2 replies; 6+ messages in thread
From: Steven Price @ 2022-04-11 15:22 UTC (permalink / raw)
  To: Thomas Gleixner, Vincent Donnefort, Peter Zijlstra
  Cc: Steven Price, linux-kernel, Baokun Li, Dongli Zhang,
	Randy Dunlap, Valentin Schneider, Yuan ZhaoXiong, YueHaibing,
	Dietmar Eggemann

Currently it's possible to trigger a case where the cpuhp_cpu_state::cpu
member is used before it has been initialised. This can cause CPU 0 to
be erroneously marked as dying and trigger a scheduler panic (full
details in v1[1]).

The two patches here fix the root cause by removing the 'cpu' member
altogether and to prevent similar confusion in the future ensure that
the cpuhp_cpu_state structures are initialised before any hotplugging
occurs.

Changes since v2[2]:
 * Remove the cpu member altogether (first patch)
 * Move the initialisation of cpuhp_cpu_state as suggested by tglx
   (second patch)

[1] https://lore.kernel.org/all/20220225134918.105796-1-steven.price@arm.com/
[2] https://lore.kernel.org/all/20220316153637.288199-1-steven.price@arm.com/

Steven Price (2):
  cpu/hotplug: Remove the 'cpu' member of cpuhp_cpu_state
  cpu/hotplug: Initialise all cpuhp_cpu_state structs earlier

 kernel/cpu.c | 58 ++++++++++++++++++++++++++++------------------------
 1 file changed, 31 insertions(+), 27 deletions(-)

-- 
2.25.1


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

end of thread, other threads:[~2022-04-13 19:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-11 15:22 [PATCH v3 0/2] cpu/hotplug: Fix cpuhp_cpu_state used before init Steven Price
2022-04-11 15:22 ` [PATCH v3 1/2] cpu/hotplug: Remove the 'cpu' member of cpuhp_cpu_state Steven Price
2022-04-13 19:25   ` [tip: smp/urgent] " tip-bot2 for Steven Price
2022-04-13 19:32   ` [tip: smp/core] " tip-bot2 for Steven Price
2022-04-11 15:22 ` [PATCH v3 2/2] cpu/hotplug: Initialise all cpuhp_cpu_state structs earlier Steven Price
2022-04-13 19:32   ` [tip: smp/core] " tip-bot2 for Steven Price

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®