Skip to content

Commit

Permalink
um: Fix hung task in fix_range_common()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
richardweinberger committed Jul 20, 2014
1 parent 284e6d3 commit 468f659
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion arch/um/kernel/tlb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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();
}
}

Expand Down

0 comments on commit 468f659

Please sign in to comment.