summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBaoquan He <bhe@redhat.com>2021-01-22 15:42:14 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-02-03 23:23:23 +0100
commit8445d9564504e40fd0e3b5323079d4ea02715030 (patch)
treea36abdd5c4e39bbfc0cc74551a26f94601c9e144
parent98fa0addc3ce9d6ad079059c46a1ae53fa3c92d6 (diff)
downloadlinux-stable-8445d9564504e40fd0e3b5323079d4ea02715030.tar.gz
linux-stable-8445d9564504e40fd0e3b5323079d4ea02715030.tar.bz2
linux-stable-8445d9564504e40fd0e3b5323079d4ea02715030.zip
kernel: kexec: remove the lock operation of system_transition_mutex
commit 56c91a18432b631ca18438841fd1831ef756cabf upstream. Function kernel_kexec() is called with lock system_transition_mutex held in reboot system call. While inside kernel_kexec(), it will acquire system_transition_mutex agin. This will lead to dead lock. The dead lock should be easily triggered, it hasn't caused any failure report just because the feature 'kexec jump' is almost not used by anyone as far as I know. An inquiry can be made about who is using 'kexec jump' and where it's used. Before that, let's simply remove the lock operation inside CONFIG_KEXEC_JUMP ifdeffery scope. Fixes: 55f2503c3b69 ("PM / reboot: Eliminate race between reboot and suspend") Signed-off-by: Baoquan He <bhe@redhat.com> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Pingfan Liu <kernelfans@gmail.com> Cc: 4.19+ <stable@vger.kernel.org> # 4.19+ Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--kernel/kexec_core.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c
index faeec8255e7e..6b3d7f7211dd 100644
--- a/kernel/kexec_core.c
+++ b/kernel/kexec_core.c
@@ -1130,7 +1130,6 @@ int kernel_kexec(void)
#ifdef CONFIG_KEXEC_JUMP
if (kexec_image->preserve_context) {
- lock_system_sleep();
pm_prepare_console();
error = freeze_processes();
if (error) {
@@ -1193,7 +1192,6 @@ int kernel_kexec(void)
thaw_processes();
Restore_console:
pm_restore_console();
- unlock_system_sleep();
}
#endif