um: Fix hung task in fix_range_common()
authorRichard Weinberger <richard@nod.at>
Sun, 20 Jul 2014 11:16:20 +0000 (13:16 +0200)
committerRichard Weinberger <richard@nod.at>
Sun, 20 Jul 2014 11:16:20 +0000 (13:16 +0200)
If do_ops() fails we have to release current->mm->mmap_sem
otherwise the failing task will never terminate.

Reported-by: Toralf Förster <toralf.foerster@gmx.de>
Signed-off-by: Richard Weinberger <richard@nod.at>
arch/um/kernel/tlb.c

index 1fc619e5dfe9edbaff8130881c284caa0d4846c2..f1b3eb14b855ccd8740b328085521c0b432407d2 100644 (file)
@@ -12,6 +12,7 @@
 #include <mem_user.h>
 #include <os.h>
 #include <skas.h>
+#include <kern_util.h>
 
 struct host_vm_change {
        struct host_vm_op {
@@ -286,8 +287,11 @@ void fix_range_common(struct mm_struct *mm, unsigned long start_addr,
        /* This is not an else because ret is modified above */
        if (ret) {
                printk(KERN_ERR "fix_range_common: failed, killing current "
-                      "process\n");
+                      "process: %d\n", task_tgid_vnr(current));
+               /* We are under mmap_sem, release it such that current can terminate */
+               up_write(&current->mm->mmap_sem);
                force_sig(SIGKILL, current);
+               do_signal();
        }
 }