* + kernel-reboot-avoid-potential-deadlocks-during-suspension.patch added to mm-nonmm-unstable branch
@ 2026-10-20 21:44 Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2026-10-20 21:44 UTC (permalink / raw)
To: mm-commits, syzbot+1f0fbc2561b3e5d51b91, rafael, kernelfans,
brads, eadavis, akpm
The patch titled
Subject: kernel/reboot: Avoid potential deadlocks during suspension
has been added to the -mm mm-nonmm-unstable branch. Its filename is
kernel-reboot-avoid-potential-deadlocks-during-suspension.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/kernel-reboot-avoid-potential-deadlocks-during-suspension.patch
This patch will later appear in the mm-nonmm-unstable branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via various
branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there most days
------------------------------------------------------
From: Edward Adam Davis <eadavis@sina.com>
Subject: kernel/reboot: Avoid potential deadlocks during suspension
Date: Tue, 20 Oct 2026 09:05:59 +0800
Invoking reboot with LINUX_REBOOT_CMD_SW_SUSPEND causes kernel/reboot.c
to acquire system_transition_mutex and invoke hibernate(). hibernate()
calls lock_system_sleep(), which sets PF_NOFREEZE on current and attempts
to acquire system_transition_mutex again, potentially hitting:
WARNING: possible recursive locking detected
--------------------------------------------
syz.3.5755/5950 is trying to acquire lock:
ffffffff8fc04760 (system_transition_mutex){+.+.}-{4:4}, at: lock_system_sleep+0x49/0x70 kernel/power/main.c:71
but task is already holding lock:
ffffffff8fc04760 (system_transition_mutex){+.+.}-{4:4}, at: __do_sys_reboot kernel/reboot.c:774 [inline]
ffffffff8fc04760 (system_transition_mutex){+.+.}-{4:4}, at: __se_sys_reboot+0x223/0x460 kernel/reboot.c:738
other info that might help us debug this:
Possible unsafe locking scenario:
CPU0
----
lock(system_transition_mutex);
lock(system_transition_mutex);
*** DEADLOCK ***
May be due to missing lock nesting notation
locks held by syz.3.5755/5950: 1, last CPU#0:
#0: ffffffff8fc04760 (system_transition_mutex){+.+.}-{4:4}, at: __do_sys_reboot kernel/reboot.c:774 [inline]
#0: ffffffff8fc04760 (system_transition_mutex){+.+.}-{4:4}, at: __se_sys_reboot+0x223/0x460 kernel/reboot.c:738
Call Trace:
lock_system_sleep+0x49/0x70 kernel/power/main.c:71
hibernate+0x162/0x680 kernel/power/hibernate.c:784
__do_sys_reboot kernel/reboot.c:816 [inline]
Move the suspension operation outside the scope protected by lock
system_transition_mutex.
Link: https://lore.kernel.org/20261020010559.23031-1-eadavis@sina.com
Fixes: 55f2503c3b69 ("PM / reboot: Eliminate race between reboot and suspend")
Signed-off-by: Edward Adam Davis <eadavis@sina.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reported-by: <syzbot+1f0fbc2561b3e5d51b91@syzkaller.appspotmail.com>
Closes: https://syzkaller.appspot.com/bug?extid=1f0fbc2561b3e5d51b91
Tested-by: <syzbot+1f0fbc2561b3e5d51b91@syzkaller.appspotmail.com>
Reviewed-by: Bradley Morgan <brads@mainlining.org>
Cc: Pingfan Liu <kernelfans@gmail.com>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>
---
kernel/reboot.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/kernel/reboot.c~kernel-reboot-avoid-potential-deadlocks-during-suspension
+++ a/kernel/reboot.c
@@ -804,8 +804,8 @@ SYSCALL_DEFINE4(reboot, int, magic1, int
#ifdef CONFIG_HIBERNATION
case LINUX_REBOOT_CMD_SW_SUSPEND:
- ret = hibernate();
- break;
+ mutex_unlock(&system_transition_mutex);
+ return hibernate();
#endif
default:
_
Patches currently in -mm which might be from eadavis@sina.com are
kernel-reboot-avoid-potential-deadlocks-during-suspension.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-10-20 21:44 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-20 21:44 + kernel-reboot-avoid-potential-deadlocks-during-suspension.patch added to mm-nonmm-unstable branch Andrew Morton
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.