A patch for the file kernel/fork.c

From: André Pereira de Almeida
Date: Wed May 04 2005 - 09:48:07 EST


I think that the file kernel/fork.c should be patched as following:

--- linux-2.6.12-rc3.orig/kernel/fork.c 2005-05-03 22:31:21.000000000 -0300
+++ linux-2.6.12-rc3/kernel/fork.c 2005-05-04 09:37:46.000000000 -0300
@@ -429,7 +429,7 @@
tsk->vfork_done = NULL;
complete(vfork_done);
}
- if (tsk->clear_child_tid && atomic_read(&mm->mm_users) > 1) {
+ if (mm && tsk->clear_child_tid && atomic_read(&mm->mm_users) > 1) {
u32 __user * tidptr = tsk->clear_child_tid;
tsk->clear_child_tid = NULL;

If a process is killed and, for some reason, when closing all files a pagefault is generated (should not happen, but...) after the function exit_mm had been called, the kernel will try to exit this process again, calling exit_mm and mm_release with a null mm, and will generate another pagefault in atomic_read(&mm->mm_users), and so on and the system will hang. I think this patch solve this problem.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/