]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
s390/kvm: fix deadlock when killed by oom
authorClaudio Imbrenda <imbrenda@linux.vnet.ibm.com>
Mon, 16 Jul 2018 08:38:57 +0000 (10:38 +0200)
committerThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Fri, 9 Nov 2018 18:59:48 +0000 (16:59 -0200)
commitaad06ea13f88d8875fa2d70c0b36048cfca13879
tree9dd60cc2c7962a9c70bd323a8b91b225cc41361a
parent7d149bf740113b48b7a87d1a9571ac1a8a0a048a
s390/kvm: fix deadlock when killed by oom

BugLink: http://bugs.launchpad.net/bugs/1800849
When the oom killer kills a userspace process in the page fault handler
while in guest context, the fault handler fails to release the mm_sem
if the FAULT_FLAG_RETRY_NOWAIT option is set. This leads to a deadlock
when tearing down the mm when the process terminates. This bug can only
happen when pfault is enabled, so only KVM clients are affected.

The problem arises in the rare cases in which handle_mm_fault does not
release the mm_sem. This patch fixes the issue by manually releasing
the mm_sem when needed.

Fixes: 24eb3a824c4f3 ("KVM: s390: Add FAULT_FLAG_RETRY_NOWAIT for guest fault")
Cc: <stable@vger.kernel.org> # 3.15+
Signed-off-by: Claudio Imbrenda <imbrenda@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
(cherry picked from commit 306d6c49ac9ded11114cb53b0925da52f2c2ada1)
Signed-off-by: Frank Heimes <frank.heimes@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
arch/s390/mm/fault.c