]> git.karo-electronics.de Git - karo-tx-linux.git/commit
[PATCH] fix de_thread() vs send_group_sigqueue() race
authorOleg Nesterov <oleg@tv-sign.ru>
Wed, 9 Nov 2005 18:22:14 +0000 (10:22 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 11 Nov 2005 05:18:55 +0000 (21:18 -0800)
commit6b85cfab9d15c70392cd79896ae1a11d88498e9f
treec43ba10a2aa1258a3423aeb14b488d0ffa554f26
parentd212503f82d7ef3b63ed20ab97bb68a69616d06c
[PATCH] fix de_thread() vs send_group_sigqueue() race

When non-leader thread does exec, de_thread calls release_task(leader) before
calling exit_itimers(). If local timer interrupt happens in between, it can
oops in send_group_sigqueue() while taking ->sighand->siglock == NULL.

However, we can't change send_group_sigqueue() to check p->signal != NULL,
because sys_timer_create() does get_task_struct() only in SIGEV_THREAD_ID
case. So it is possible that this task_struct was already freed and we can't
trust p->signal.

This patch changes de_thread() so that leader released after exit_itimers()
call.

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Signed-off-by: Chris Wright <chrisw@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/exec.c