The patch titled posix-timers: don't switch to ->group_leader if ->it_process dies has been removed from the -mm tree. Its filename was posix-timers-dont-switch-to-group_leader-if-it_process-dies.patch This patch was dropped because it was merged into mainline or a subsystem tree The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: posix-timers: don't switch to ->group_leader if ->it_process dies From: Oleg Nesterov <oleg@xxxxxxxxxx> posix_timer_event() drops SIGEV_THREAD_ID and switches to ->group_leader if send_sigqueue() fails. This is not very useful and doesn't work reliably. send_sigqueue() can only fail if ->it_process is dead. But it can die before it dequeues the SI_TIMER signal, in that case the timer stops anyway. Remove this code. I guess it was needed a long ago to ensure that the timer is not destroyed when when its creator thread dies. Q: perhaps it makes sense to change sys_timer_settime() to return an error if ->it_process is dead? Signed-off-by: Oleg Nesterov <oleg@xxxxxxxxxx> Cc: Roland McGrath <roland@xxxxxxxxxx> Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- kernel/posix-timers.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff -puN kernel/posix-timers.c~posix-timers-dont-switch-to-group_leader-if-it_process-dies kernel/posix-timers.c --- a/kernel/posix-timers.c~posix-timers-dont-switch-to-group_leader-if-it_process-dies +++ a/kernel/posix-timers.c @@ -313,6 +313,7 @@ void do_schedule_next_timer(struct sigin int posix_timer_event(struct k_itimer *timr, int si_private) { + int shared, ret; /* * FIXME: if ->sigq is queued we can race with * dequeue_signal()->do_schedule_next_timer(). @@ -331,20 +332,10 @@ int posix_timer_event(struct k_itimer *t timr->sigq->info.si_tid = timr->it_id; timr->sigq->info.si_value = timr->it_sigev_value; - if (timr->it_sigev_notify & SIGEV_THREAD_ID) { - struct task_struct *leader; - int ret = send_sigqueue(timr->sigq, timr->it_process, 0); - - if (likely(ret >= 0)) - return ret; - - timr->it_sigev_notify = SIGEV_SIGNAL; - leader = timr->it_process->group_leader; - put_task_struct(timr->it_process); - timr->it_process = leader; - } - - return send_sigqueue(timr->sigq, timr->it_process, 1); + shared = !(timr->it_sigev_notify & SIGEV_THREAD_ID); + ret = send_sigqueue(timr->sigq, timr->it_process, shared); + /* If we failed to send the signal the timer stops. */ + return ret > 0; } EXPORT_SYMBOL_GPL(posix_timer_event); _ Patches currently in -mm which might be from oleg@xxxxxxxxxx are git-tip.patch posix-timers-use-struct-pid-instead-of-struct-task_struct.patch posix-timers-check-it_signal-instead-of-it_pid-to-validate-the-timer.patch posix-timers-simplify-de_thread-exit_itimers-path.patch signal-procfs-lock_task_sighand-do-not-need-rcu_read_lock.patch make-ptrace_untrace-static.patch coredump-format_corename-dont-append-%pid-if-multi-threaded.patch add-config_core_dump_default_elf_headers.patch kthread_bind-use-wait_task_inactivetask_uninterruptible.patch pid_ns-de_thread-kill-the-now-unneeded-child_reaper-change.patch pid_ns-kill-the-now-unused-task_child_reaper.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html