diff options
author | Bodo Stroesser <bstroesser@fujitsu-siemens.com> | 2005-05-07 00:30:54 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-05-07 01:09:30 -0400 |
commit | 0f7e663dea7f0e22f3b2d07156c5e9d2e8656610 (patch) | |
tree | 669450b10e1677d3ea65aa7695a7834f791ce329 /arch/um/kernel/process_kern.c | |
parent | b8bd0220c1ac6273eda66e25d992654219f846b6 (diff) |
[PATCH] uml: Fix process exit race
tt-mode closes switch_pipes in exit_thread_tt and kills processes in
switch_to_tt, if the exit_state is EXIT_DEAD or EXIT_ZOMBIE.
In very rare cases the exiting process can be scheduled out after having set
exit_state and closed switch_pipes (from release_task it calls proc_pid_flush,
which might sleep). If this process is to be restarted, UML failes in
switch_to_tt with:
write of switch_pipe failed, err = 9
We fix this by closing switch_pipes not in exit_thread_tt, but later in
release_thread_tt. Additionally, we set switch_pipe[0] = 0 after closing.
switch_to_tt must not kill "from" process depending on its exit_state, but
must kill it after release_thread was processed only, so it examines
switch_pipe[0] for its decision.
Signed-off-by: Bodo Stroesser <bstroesser@fujitsu-siemens.com>
Signed-off-by: Jeff Dike <jdike@addtoit.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/um/kernel/process_kern.c')
-rw-r--r-- | arch/um/kernel/process_kern.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/arch/um/kernel/process_kern.c b/arch/um/kernel/process_kern.c index 3dcb080c44a0..c1adf7ba3fd1 100644 --- a/arch/um/kernel/process_kern.c +++ b/arch/um/kernel/process_kern.c | |||
@@ -142,7 +142,6 @@ void release_thread(struct task_struct *task) | |||
142 | 142 | ||
143 | void exit_thread(void) | 143 | void exit_thread(void) |
144 | { | 144 | { |
145 | CHOOSE_MODE(exit_thread_tt(), exit_thread_skas()); | ||
146 | unprotect_stack((unsigned long) current_thread); | 145 | unprotect_stack((unsigned long) current_thread); |
147 | } | 146 | } |
148 | 147 | ||