<div dir="ltr"><div dir="ltr"><div>BugLink: <a href="http://bugs.launchpad.net/bugs/1800849">http://bugs.launchpad.net/bugs/1800849</a></div><div><br></div><div>== SRU Justification ==</div><div><br></div><div>Description: kvm: fix deadlock when killed by oom</div><div>Symptom: oom killer leaves processes in a deadlock state.</div><div>Problem: The problem arises in the rare cases in which</div><div>         handle_mm_fault does not release the mm_sem.</div><div>Solution: Correct the issue by manually release the mm_sem when needed.</div><div><br></div><div>== Fix ==</div><div><br></div><div>306d6c49ac9ded11114cb53b0925da52f2c2ada1 ("s390/kvm: fix deadlock when killed by oom")</div><div><br></div><div>== Patch ==</div><div><br></div><div>commit 306d6c49ac9ded11114cb53b0925da52f2c2ada1</div><div>Author: Claudio Imbrenda <<a href="mailto:imbrenda@linux.vnet.ibm.com">imbrenda@linux.vnet.ibm.com</a>></div><div>Date:   Mon Jul 16 10:38:57 2018 +0200</div><div><br></div><div>    s390/kvm: fix deadlock when killed by oom</div><div>    </div><div>    When the oom killer kills a userspace process in the page fault handler</div><div>    while in guest context, the fault handler fails to release the mm_sem</div><div>    if the FAULT_FLAG_RETRY_NOWAIT option is set. This leads to a deadlock</div><div>    when tearing down the mm when the process terminates. This bug can only</div><div>    happen when pfault is enabled, so only KVM clients are affected.</div><div>    </div><div>    The problem arises in the rare cases in which handle_mm_fault does not</div><div>    release the mm_sem. This patch fixes the issue by manually releasing</div><div>    the mm_sem when needed.</div><div>    </div><div>    Fixes: 24eb3a824c4f3 ("KVM: s390: Add FAULT_FLAG_RETRY_NOWAIT for guest fault")</div><div>    Cc: <<a href="mailto:stable@vger.kernel.org">stable@vger.kernel.org</a>> # 3.15+</div><div>    Signed-off-by: Claudio Imbrenda <<a href="mailto:imbrenda@linux.vnet.ibm.com">imbrenda@linux.vnet.ibm.com</a>></div><div>    Signed-off-by: Martin Schwidefsky <<a href="mailto:schwidefsky@de.ibm.com">schwidefsky@de.ibm.com</a>></div><div><br></div><div>== Regression Potential ==</div><div><br></div><div>Low and minimal, because:</div><div><br></div><div>- code change is s390x only</div><div>- limited to one single file: /arch/s390/mm/fault.c</div><div>- just two additional lines added (if stmt)</div><div>- Xenial and Cosmic already have this commit via upstream stable updates.</div><div>- Hence patch is just missing in Bionic.</div><div>- Test kernel was made available.</div><div><br></div><div>== Test Case ==</div><div><br></div><div>Create numerous KVM guests so that the host starts swapping</div><div>and memory becomes overcomitted and the oom killer is triggered.</div><div><br></div></div></div>