linux/kernel
Oleg Nesterov 834d216e1f signalfd: fix interaction with posix-timers
dequeue_signal:

	if (__SI_TIMER) {
		spin_unlock(&tsk->sighand->siglock);
		do_schedule_next_timer(info);
		spin_lock(&tsk->sighand->siglock);
	}

Unless tsk == curent, this is absolutely unsafe: nothing prevents tsk from
exiting. If signalfd was passed to another process, do_schedule_next_timer()
is just wrong.

Add yet another "tsk == current" check into dequeue_signal().

This patch fixes an oopsable bug, but breaks the scheduling of posix timers
if the shared __SI_TIMER signal was fetched via signalfd attached to another
sub-thread. Mostly fixed by the next patch.

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Davide Libenzi <davidel@xmailserver.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Michael Kerrisk <mtk-manpages@gmx.net>
Cc: Roland McGrath <roland@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-08-22 19:52:46 -07:00
..
irq free_irq(): fix DEBUG_SHIRQ handling 2007-08-22 19:52:44 -07:00
power Hibernation: do not try to mark invalid PFNs as nosave 2007-08-11 15:47:40 -07:00
time timer: remove clockevents_unregister_notifier 2007-08-11 15:47:42 -07:00
.gitignore
Kconfig.hz
Kconfig.preempt
Makefile
acct.c
audit.c
audit.h
auditfilter.c
auditsc.c kernel/auditsc.c: fix an off-by-one 2007-08-22 19:52:44 -07:00
capability.c
compat.c
configs.c
cpu.c
cpuset.c
delayacct.c
die_notifier.c
dma.c
exec_domain.c
exit.c Kill some obsolete sub-thread-ptrace stuff 2007-08-03 15:06:33 -07:00
extable.c
fork.c
futex.c futex_unlock_pi() hurts my brain and may cause application deadlock 2007-08-22 19:52:44 -07:00
futex_compat.c
hrtimer.c
itimer.c
kallsyms.c
kexec.c
kfifo.c
kmod.c kernel-doc fix for kmod.c 2007-07-26 11:33:06 -07:00
kprobes.c fix compilation with gcc 4.2 2007-08-11 15:47:42 -07:00
ksysfs.c
kthread.c kthread: silence bogus section mismatch warning 2007-07-31 15:39:42 -07:00
latency.c
lockdep.c
lockdep_internals.h
lockdep_proc.c Fix leak on /proc/lockdep_stats 2007-07-31 15:39:40 -07:00
module.c
mutex-debug.c
mutex-debug.h
mutex.c
mutex.h
nsproxy.c
panic.c
params.c modules: better error messages when modules fail to load due to a sysfs problem. 2007-07-30 14:25:23 -07:00
pid.c
posix-cpu-timers.c
posix-timers.c posix-timers: fix creation race 2007-08-22 19:52:46 -07:00
printk.c fix - ensure we don't use bootconsoles after init has been released 2007-08-21 20:23:53 -07:00
profile.c fix compilation with gcc 4.2 2007-08-11 15:47:42 -07:00
ptrace.c
rcupdate.c
rcutorture.c
relay.c Fix a use after free bug in kernel->userspace relay file support 2007-07-31 15:39:42 -07:00
resource.c
rtmutex-debug.c
rtmutex-debug.h
rtmutex-tester.c
rtmutex.c
rtmutex.h
rtmutex_common.h
rwsem.c
sched.c sched: run_rebalance_domains: s/SCHED_IDLE/CPU_IDLE/ 2007-08-12 18:08:19 +02:00
sched_debug.c sched debug: dont print kernel address in /proc/sched_debug 2007-08-10 23:05:11 +02:00
sched_fair.c sched: fix sleeper bonus 2007-08-12 18:08:19 +02:00
sched_idletask.c sched: remove the 'u64 now' parameter from ->put_prev_task() 2007-08-09 11:16:49 +02:00
sched_rt.c sched: remove the 'u64 now' parameter from ->put_prev_task() 2007-08-09 11:16:49 +02:00
sched_stats.h [PATCH] sched: add schedstat_set() API 2007-08-02 17:41:40 +02:00
seccomp.c
signal.c signalfd: fix interaction with posix-timers 2007-08-22 19:52:46 -07:00
softirq.c
softlockup.c
spinlock.c
srcu.c
stacktrace.c
stop_machine.c
sys.c Replace CONFIG_SOFTWARE_SUSPEND with CONFIG_HIBERNATION 2007-07-29 16:45:38 -07:00
sys_ni.c
sysctl.c Remove double inclusion of linux/capability.h 2007-08-19 10:12:32 -07:00
taskstats.c
time.c
timer.c
tsacct.c
uid16.c
user.c
user_namespace.c
utsname.c
utsname_sysctl.c
wait.c
workqueue.c