]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commit
KVM: s390: fix locking order problem in enable_sie
authorChristian Borntraeger <borntraeger@de.ibm.com>
Wed, 21 May 2008 11:37:29 +0000 (13:37 +0200)
committerAvi Kivity <avi@qumranet.com>
Fri, 6 Jun 2008 18:08:26 +0000 (21:08 +0300)
commit74b6b522ec83f9c44fc7743f2adcb24664aa8f45
tree8e50f409eaf8b906d2fca6cf45cdbf8c7812bf83
parentb8cee18cc75d7b9dbe6c6526dfae9ab49e84fa95
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 <borntraeger@de.ibm.com>
Signed-off-by: Carsten Otte <cotte@de.ibm.com>
Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
arch/s390/mm/pgtable.c