diff options
author | Oleg Nesterov <oleg@tv-sign.ru> | 2007-08-22 14:01:42 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-08-30 23:01:01 -0700 |
commit | 68159e50ef135abc07fb2b866ade8655e93d17cb (patch) | |
tree | 9d86853a6a00304f63c22db4d899072f94932cb5 /fs/signalfd.c | |
parent | f24e131c7e06c4f0bbb69bebf66d16bde48c3f31 (diff) | |
download | lwn-68159e50ef135abc07fb2b866ade8655e93d17cb.tar.gz lwn-68159e50ef135abc07fb2b866ade8655e93d17cb.zip |
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>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'fs/signalfd.c')
0 files changed, 0 insertions, 0 deletions