linux/kernel
Andrew Morton 05eeae208d [PATCH] find_task_by_pid() needs tasklist_lock
A couple of places are forgetting to take it.

The kswapd case is probably unimportant.  keventd_create_kthread() was racy.

The whole thing is a bit flakey: you start a kernel thread, get its pid from
kernel_thread() then look up its task_struct.

a) It assumes that pid recycling takes a "long" time.

b) We get a task_struct but no reference was taken on it.  The owner of the
   kswapd and kthread task_struct*'s must assume that the new thread won't
   exit unexpectedly.  Because if it does, they're left holding dead memory
   and any attempt to control or stop that task will crash.

Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-03-25 08:22:57 -08:00
..
irq [PATCH] IRQ: prevent enabling of previously disabled interrupt 2006-03-25 08:22:55 -08:00
power
.gitignore
acct.c
audit.c
auditsc.c
capability.c [PATCH] refactor capable() to one implementation, add __capable() helper 2006-03-25 08:22:56 -08:00
compat.c
configs.c
cpu.c
cpuset.c
dma.c
exec_domain.c
exit.c
extable.c
fork.c
futex.c
hrtimer.c
intermodule.c
itimer.c [PATCH] Validate and sanitze itimer timeval from userspace 2006-03-25 08:22:49 -08:00
kallsyms.c
Kconfig.hz
Kconfig.preempt
kexec.c
kfifo.c
kmod.c
kprobes.c
ksysfs.c [PATCH] fix build error if CONFIG_SYSFS=n 2006-03-24 07:33:31 -08:00
kthread.c [PATCH] find_task_by_pid() needs tasklist_lock 2006-03-25 08:22:57 -08:00
Makefile
module.c [PATCH] Remove MODULE_PARM 2006-03-25 08:22:52 -08:00
mutex-debug.c
mutex-debug.h
mutex.c
mutex.h
panic.c
params.c [PATCH] kernel/params.c: make param_array() static 2006-03-25 08:22:52 -08:00
pid.c
posix-cpu-timers.c
posix-timers.c
printk.c
profile.c
ptrace.c
rcupdate.c
rcutorture.c [PATCH] Remove MODULE_PARM 2006-03-25 08:22:52 -08:00
relay.c
resource.c
sched.c
seccomp.c
signal.c
softirq.c
softlockup.c [PATCH] timer irq driven soft watchdog fix 2006-03-25 08:22:48 -08:00
spinlock.c
stop_machine.c
sys_ni.c
sys.c [PATCH] refactor capable() to one implementation, add __capable() helper 2006-03-25 08:22:56 -08:00
sysctl.c
time.c
timer.c [PATCH] sys_alarm() unsigned signed conversion fixup 2006-03-25 08:22:48 -08:00
uid16.c
user.c
wait.c
workqueue.c