Skip to content

Commit

Permalink
kernel: kexec: remove the lock operation of system_transition_mutex
Browse files Browse the repository at this point in the history
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: 55f2503 ("PM / reboot: Eliminate race between reboot and suspend")
Signed-off-by: Baoquan He <[email protected]>
Reported-by: Dan Carpenter <[email protected]>
Reviewed-by: Pingfan Liu <[email protected]>
Cc: 4.19+ <[email protected]> # 4.19+
Signed-off-by: Rafael J. Wysocki <[email protected]>
  • Loading branch information
Baoquan He authored and rafaeljw committed Jan 25, 2021
1 parent 6ee1d74 commit 56c91a1
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions kernel/kexec_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1134,7 +1134,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) {
Expand Down Expand Up @@ -1197,7 +1196,6 @@ int kernel_kexec(void)
thaw_processes();
Restore_console:
pm_restore_console();
unlock_system_sleep();
}
#endif

Expand Down

0 comments on commit 56c91a1

Please sign in to comment.