aboutsummaryrefslogtreecommitdiff
path: root/kernel/exit.c
diff options
context:
space:
mode:
authorAlexander Nyberg <alexn@dsv.su.se>2005-06-23 00:09:13 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-23 09:45:20 -0700
commitdf164db5fd16888ddbe2a63a47b2f6dda9a428b5 (patch)
treecc9aaf42f93761083e58e1d9d8d22261e0ff3686 /kernel/exit.c
parent5f45f1a78fbac3cc859ec10c5366e97d20d40fa2 (diff)
[PATCH] avoid resursive oopses
Prevent recursive faults in do_exit() by leaving the task alone and wait for reboot. This may allow a more graceful shutdown and possibly save the original oops. Signed-off-by: Alexander Nyberg <alexn@telia.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/exit.c')
-rw-r--r--kernel/exit.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/kernel/exit.c b/kernel/exit.c
index 2ef2ad54020..c2bdf6fb61a 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -793,6 +793,17 @@ fastcall NORET_TYPE void do_exit(long code)
ptrace_notify((PTRACE_EVENT_EXIT << 8) | SIGTRAP);
}
+ /*
+ * We're taking recursive faults here in do_exit. Safest is to just
+ * leave this task alone and wait for reboot.
+ */
+ if (unlikely(tsk->flags & PF_EXITING)) {
+ printk(KERN_ALERT
+ "Fixing recursive fault but reboot is needed!\n");
+ set_current_state(TASK_UNINTERRUPTIBLE);
+ schedule();
+ }
+
tsk->flags |= PF_EXITING;
/*