linux/arch/um/kernel
Bodo Stroesser 0f7e663dea [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>
2005-05-06 22:09:30 -07:00
..
skas [PATCH] uml: Fix process exit race 2005-05-06 22:09:30 -07:00
tt [PATCH] uml: Fix process exit race 2005-05-06 22:09:30 -07:00
checksum.c [PATCH] uml: s390 preparation, checksumming done in arch code 2005-05-05 16:36:38 -07:00
config.c.in Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
dyn.lds.S Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
exec_kern.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
exitcode.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
gmon_syms.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
gprof_syms.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
helper.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
init_task.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
initrd_kern.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
initrd_user.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
irq_user.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
irq.c [PATCH] uml: Fix SIGWINCH relaying 2005-05-05 16:36:36 -07:00
ksyms.c [PATCH] uml: s390 preparation, delay moved to arch 2005-05-05 16:36:38 -07:00
main.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
Makefile [PATCH] uml: Makefile cleanup 2005-05-06 22:09:30 -07:00
mem_user.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
mem.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
physmem.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
process_kern.c [PATCH] uml: Fix process exit race 2005-05-06 22:09:30 -07:00
process.c [PATCH] uml: Fix SIGWINCH relaying 2005-05-05 16:36:36 -07:00
ptrace.c [PATCH] uml: S390 preparation, peekusr/pokeusr defined by subarch 2005-05-06 22:09:29 -07:00
reboot.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
resource.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
sigio_kern.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
sigio_user.c [PATCH] uml: Fix SIGWINCH relaying 2005-05-05 16:36:36 -07:00
signal_kern.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
signal_user.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
smp.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
syscall_kern.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
syscall_user.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
sysrq.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
tempfile.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
time_kern.c [PATCH] uml: s390 preparation, delay moved to arch 2005-05-05 16:36:38 -07:00
time.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
tlb.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
trap_kern.c [PATCH] uml: S390 preparation, abstract host page fault data 2005-05-05 16:36:36 -07:00
trap_user.c [PATCH] uml: S390 preparation, abstract host page fault data 2005-05-05 16:36:36 -07:00
tty_log.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
uaccess_user.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
um_arch.c [PATCH] uml: command line handling cleanup 2005-05-06 22:09:29 -07:00
umid.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
uml.lds.S Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
user_util.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
vmlinux.lds.S [PATCH] uml: include the linker script rather than symlink it 2005-05-05 16:36:33 -07:00