From: Sébastien Dugué Could you replace make-good_sigevent-non-static.patch with this patch, as it fixes some problems reported by Oleg Nesterov. Oleg, chime in if you still see something I missed. Hopefully I will have gotten it right this time. Sorry for the hassle. Sébastien. Make good_sigevent() non-static and rename it Move good_sigevent() from posix-timers.c to signal.c where it belongs, clean it up, rename it to sigevent_find_task() to better describe what the function does and make it non-static so that it can be used by other subsystems. Signed-off-by: Sébastien Dugué Cc: Bharata B Rao Cc: Christoph Hellwig Cc: Suparna Bhattacharya Cc: Zach Brown Cc: Oleg Nesterov Cc: Badari Pulavarty Cc: Benjamin LaHaise Cc: Jean Pierre Dion Signed-off-by: Andrew Morton --- kernel/signal.c | 16 ++++++++++------ 1 files changed, 10 insertions(+), 6 deletions(-) diff -puN kernel/signal.c~make-good_sigevent-non-static-fix kernel/signal.c --- a/kernel/signal.c~make-good_sigevent-non-static-fix +++ a/kernel/signal.c @@ -1097,18 +1097,22 @@ int group_send_sig_info(int sig, struct */ struct task_struct * sigevent_find_task(sigevent_t * event) { - struct task_struct *task = NULL; + struct task_struct *task = current->group_leader; - if (event->sigev_signo <= 0 || event->sigev_signo > SIGRTMAX) - return NULL; + if ((event->sigev_notify & ~SIGEV_THREAD_ID) != SIGEV_NONE) { + if (event->sigev_signo <= 0 || event->sigev_signo > SIGRTMAX) + return NULL; + } + + if (event->sigev_notify & SIGEV_THREAD_ID) { + if ((event->sigev_notify & ~SIGEV_THREAD_ID) != SIGEV_SIGNAL) + return NULL; - if ((event->sigev_notify & SIGEV_THREAD_ID ) == SIGEV_THREAD_ID) { task = find_task_by_pid(event->sigev_notify_thread_id); if (!task || task->tgid != current->tgid) task = NULL; - } else if (event->sigev_notify == SIGEV_SIGNAL) - task = current->group_leader; + } return task; } _