X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=fs%2Fexec.c;h=222ab1c572d884762bae366086bbe145f8e0f65b;hb=8410a546765c10d929b82d1e8237398904a79283;hp=48871917d3639c2b4d679ddd47d0db10651dc88c;hpb=5028770a42e7bc4d15791a44c28f0ad539323807;p=pandora-kernel.git diff --git a/fs/exec.c b/fs/exec.c index 48871917d363..222ab1c572d8 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -642,6 +642,18 @@ static inline int de_thread(struct task_struct *tsk) count = 2; if (thread_group_leader(current)) count = 1; + else { + /* + * The SIGALRM timer survives the exec, but needs to point + * at us as the new group leader now. We have a race with + * a timer firing now getting the old leader, so we need to + * synchronize with any firing (by calling del_timer_sync) + * before we can safely let the old group leader die. + */ + sig->real_timer.data = (unsigned long)current; + if (del_timer_sync(&sig->real_timer)) + add_timer(&sig->real_timer); + } while (atomic_read(&sig->count) > count) { sig->group_exit_task = current; sig->notify_count = count;