The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH 0/2] Fix a few snafus in the reboot code
@ 2026-11-26 21:47 Bradley Morgan
  2026-11-26 21:47 ` [PATCH 1/2] reboot: fix platform sys_off handler reuse with NULL cb_data Bradley Morgan
  2026-11-26 21:47 ` [PATCH 2/2] reboot: register legacy pm_power_off once at boot Bradley Morgan
  0 siblings, 2 replies; 3+ messages in thread
From: Bradley Morgan @ 2026-11-26 21:47 UTC (permalink / raw)
  To: Andrew Morton, Rafael J . Wysocki
  Cc: Dmitry Osipenko, Max Filippov, Chris Zankel, Andrew Davis,
	Oleg Nesterov, Petr Mladek, linux-kernel, Bradley Morgan

In reboot, i have found a few small snafus which i have fixed,

Patch 1 fixes a small snafu in platform_sys_off_handler,
where **IF** a caller passes NULL for cb_data, a second
SYS_OFF_PRIO_PLATFORM registration thinks that 
platform_sys_off_handler is still free, hence, it reuses
the **SAME** struct, then links the same notifier_block
into two lists at once...

Patch 2 also fixes a snafu, where do_kernel_power_off()
registers a pm_power_off quickly, and then ends up 
allocating with GFP_KERNEL or calling synchronize_rcu()
with interrupts off and other CPUs stopped.

I am aware these bugs are quite "edge-casey", but better
to fix them now rather then never! :)

Happy Reviewing!

Bradley Morgan (2):
  reboot: fix platform sys_off handler reuse with NULL cb_data
  reboot: register legacy pm_power_off once at boot

 kernel/reboot.c | 83 ++++++++++++++++++++++++++++---------------------
 1 file changed, 48 insertions(+), 35 deletions(-)

-- 
2.53.0


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

end of thread, other threads:[~2026-11-26 21:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-26 21:47 [PATCH 0/2] Fix a few snafus in the reboot code Bradley Morgan
2026-11-26 21:47 ` [PATCH 1/2] reboot: fix platform sys_off handler reuse with NULL cb_data Bradley Morgan
2026-11-26 21:47 ` [PATCH 2/2] reboot: register legacy pm_power_off once at boot Bradley Morgan

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