kernel-ark/kernel
Oleg Nesterov dadac81b1b [PATCH] fix kill_proc_info() vs fork() theoretical race
copy_process:

	attach_pid(p, PIDTYPE_PID, p->pid);
	attach_pid(p, PIDTYPE_TGID, p->tgid);

What if kill_proc_info(p->pid) happens in between?

copy_process() holds current->sighand.siglock, so we are safe
in CLONE_THREAD case, because current->sighand == p->sighand.

Otherwise, p->sighand is unlocked, the new process is already
visible to the find_task_by_pid(), but have a copy of parent's
'struct pid' in ->pids[PIDTYPE_TGID].

This means that __group_complete_signal() may hang while doing

	do ... while (next_thread() != p)

We can solve this problem if we reverse these 2 attach_pid()s:

	attach_pid() does wmb()

	group_send_sig_info() calls spin_lock(), which
	provides a read barrier. // Yes ?

I don't think we can hit this race in practice, but still.

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Cc: Roland McGrath <roland@redhat.com>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-02-15 10:21:24 -08:00
..
irq
power [PATCH] Fix build failure in recent pm_prepare_* changes. 2006-02-07 16:12:33 -08:00
.gitignore
acct.c
audit.c
auditsc.c
capability.c
compat.c [PATCH] remove bogus asm/bug.h includes. 2006-02-07 20:56:35 -05:00
configs.c
cpu.c
cpuset.c
dma.c
exec_domain.c
exit.c
extable.c
fork.c [PATCH] fix kill_proc_info() vs fork() theoretical race 2006-02-15 10:21:24 -08:00
futex.c
hrtimer.c [PATCH] hrtimer: round up relative start time on low-res arches 2006-02-14 16:09:35 -08:00
intermodule.c
itimer.c
kallsyms.c
Kconfig.hz
Kconfig.preempt
kexec.c
kfifo.c
kmod.c
kprobes.c
ksysfs.c
kthread.c
Makefile
module.c
mutex-debug.c
mutex-debug.h
mutex.c
mutex.h
panic.c [PATCH] prevent recursive panic from softlockup watchdog 2006-02-10 08:13:12 -08:00
params.c
pid.c
posix-cpu-timers.c
posix-timers.c
printk.c
profile.c
ptrace.c [PATCH] compound page: no access_process_vm check 2006-02-14 16:09:33 -08:00
rcupdate.c
rcutorture.c
resource.c
sched.c [PATCH] sched: revert "filter affine wakeups" 2006-02-14 16:09:34 -08:00
seccomp.c
signal.c [PATCH] do_sigaction: cleanup ->sa_mask manipulation 2006-02-09 16:17:36 -08:00
softirq.c
softlockup.c
spinlock.c
stop_machine.c
sys_ni.c
sys.c [PATCH] kernel/sys.c NULL noise removal 2006-02-07 20:57:47 -05:00
sysctl.c
time.c
timer.c [PATCH] timer.c NULL noise removal 2006-02-07 20:57:42 -05:00
uid16.c
user.c
wait.c
workqueue.c