]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
kernel: kexec: remove the lock operation of system_transition_mutex
authorBaoquan He <bhe@redhat.com>
Fri, 22 Jan 2021 07:42:14 +0000 (15:42 +0800)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 24 Mar 2021 10:11:19 +0000 (11:11 +0100)
commit3b3920d8d6183386f8b4dcbc291ba297c64767f3
tree7a0516e229b1027f782fede5344c623b5dbbaadb
parent7fff603b62f8ec511d01e509c5eea7208293beca
kernel: kexec: remove the lock operation of system_transition_mutex

BugLink: https://bugs.launchpad.net/bugs/1916056
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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
kernel/kexec_core.c