From: Christian Borntraeger Date: Wed, 21 May 2008 11:37:29 +0000 (+0200) Subject: KVM: s390: fix locking order problem in enable_sie X-Git-Tag: v2.6.26-rc6~11^2~15 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=74b6b522ec83f9c44fc7743f2adcb24664aa8f45;p=pandora-kernel.git KVM: s390: fix locking order problem in enable_sie There are potential locking problem in enable_sie. We take the task_lock and the mmap_sem. As exit_mm uses the same locks vice versa, this triggers a lockdep warning. The second problem is that dup_mm and mmput might sleep, so we must not hold the task_lock at that moment. The solution is to dup the mm unconditional and use the task_lock before and afterwards to check if we can use the new mm. dup_mm and mmput are called outside the task_lock, but we run update_mm while holding the task_lock, protection us against ptrace. Signed-off-by: Christian Borntraeger Signed-off-by: Carsten Otte Acked-by: Martin Schwidefsky Signed-off-by: Avi Kivity --- Reading git-diff-tree failed