提交 9facd6de 编写于 作者: B Baoquan He 提交者: Zheng Zengkai

kernel: kexec: remove the lock operation of system_transition_mutex

stable inclusion
from stable-5.10.13
commit aa9a6dc6261109d72787d0b4c5bc27238ffabdbf
bugzilla: 47995

--------------------------------

commit 56c91a18 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: 55f2503c ("PM / reboot: Eliminate race between reboot and suspend")
Signed-off-by: NBaoquan He <bhe@redhat.com>
Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: NPingfan Liu <kernelfans@gmail.com>
Cc: 4.19+ <stable@vger.kernel.org> # 4.19+
Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
上级 23d4107b
......@@ -1118,7 +1118,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) {
......@@ -1181,7 +1180,6 @@ int kernel_kexec(void)
thaw_processes();
Restore_console:
pm_restore_console();
unlock_system_sleep();
}
#endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册