android_kernel_xiaomi_sm7250/kernel
Roland McGrath e03d13e985 [PATCH] Fix cpu timers exit deadlock and races
Oleg Nesterov reported an SMP deadlock.  If there is a running timer
tracking a different process's CPU time clock when the process owning
the timer exits, we deadlock on tasklist_lock in posix_cpu_timer_del via
exit_itimers.

That code was using tasklist_lock to check for a race with __exit_signal
being called on the timer-target task and clearing its ->signal.
However, there is actually no such race.  __exit_signal will have called
posix_cpu_timers_exit and posix_cpu_timers_exit_group before it does
that.  Those will clear those k_itimer's association with the dying
task, so posix_cpu_timer_del will return early and never reach the code
in question.

In addition, posix_cpu_timer_del called from exit_itimers during execve
or directly from timer_delete in the process owning the timer can race
with an exiting timer-target task to cause a double put on timer-target
task struct.  Make sure we always access cpu_timers lists with sighand
lock held.

Signed-off-by: Roland McGrath <roland@redhat.com>
Signed-off-by: Chris Wright <chrisw@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-10-19 23:02:01 -07:00
..
irq
power [PATCH] x86_64: Set up safe page tables during resume 2005-10-10 08:36:46 -07:00
acct.c
audit.c [PATCH] gfp flags annotations - part 1 2005-10-08 15:00:57 -07:00
auditsc.c
capability.c
compat.c
configs.c
cpu.c
cpuset.c [PATCH] gfp flags annotations - part 1 2005-10-08 15:00:57 -07:00
crash_dump.c
dma.c
exec_domain.c
exit.c Fix inequality comparison against "task->state" 2005-10-01 11:04:18 -07:00
extable.c
fork.c [PATCH] CPU hotplug breaks wake_up_new_task 2005-09-17 11:49:59 -07:00
futex.c
intermodule.c
itimer.c
kallsyms.c
Kconfig.hz
Kconfig.preempt
kexec.c
kfifo.c [PATCH] gfp flags annotations - part 1 2005-10-08 15:00:57 -07:00
kmod.c
kprobes.c
ksysfs.c
kthread.c
Makefile
module.c
panic.c
params.c [PATCH] Ignore trailing whitespace on kernel parameters correctly 2005-09-28 07:46:41 -07:00
pid.c
posix-cpu-timers.c [PATCH] Fix cpu timers exit deadlock and races 2005-10-19 23:02:01 -07:00
posix-timers.c
printk.c [PATCH] Add printk_clock() 2005-09-21 10:11:54 -07:00
profile.c
ptrace.c
rcupdate.c [PATCH] rcu: keep rcu callback event counter 2005-10-17 15:27:58 -07:00
resource.c
sched.c [PATCH] Fix spinlock owner debugging 2005-09-13 09:59:04 -07:00
seccomp.c
signal.c [PATCH] Fix signal sending in usbdevio on async URB completion 2005-10-10 16:16:33 -07:00
softirq.c
softlockup.c
spinlock.c
stop_machine.c
sys_ni.c
sys.c [PATCH] reboot: comment and factor the main reboot functions 2005-09-22 22:17:33 -07:00
sysctl.c
time.c [PATCH] Add missing export of getnstimeofday() 2005-10-14 17:10:12 -07:00
timer.c
uid16.c
user.c
wait.c
workqueue.c