Commit c2a0f594 authored by Linus Torvalds's avatar Linus Torvalds

Clean up subthread exec

Make sure we re-parent itimers, and use BUG_ON() instead of an explicit
conditional BUG().
parent c83d9945
...@@ -649,6 +649,7 @@ static inline int de_thread(struct task_struct *tsk) ...@@ -649,6 +649,7 @@ static inline int de_thread(struct task_struct *tsk)
} }
sig->group_exit_task = NULL; sig->group_exit_task = NULL;
sig->notify_count = 0; sig->notify_count = 0;
sig->real_timer.data = (unsigned long)current;
spin_unlock_irq(lock); spin_unlock_irq(lock);
/* /*
...@@ -675,10 +676,8 @@ static inline int de_thread(struct task_struct *tsk) ...@@ -675,10 +676,8 @@ static inline int de_thread(struct task_struct *tsk)
proc_dentry2 = proc_pid_unhash(leader); proc_dentry2 = proc_pid_unhash(leader);
write_lock_irq(&tasklist_lock); write_lock_irq(&tasklist_lock);
if (leader->tgid != current->tgid) BUG_ON(leader->tgid != current->tgid);
BUG(); BUG_ON(current->pid == current->tgid);
if (current->pid == current->tgid)
BUG();
/* /*
* An exec() starts a new thread group with the * An exec() starts a new thread group with the
* TGID of the previous thread group. Rehash the * TGID of the previous thread group. Rehash the
...@@ -726,8 +725,7 @@ static inline int de_thread(struct task_struct *tsk) ...@@ -726,8 +725,7 @@ static inline int de_thread(struct task_struct *tsk)
proc_pid_flush(proc_dentry1); proc_pid_flush(proc_dentry1);
proc_pid_flush(proc_dentry2); proc_pid_flush(proc_dentry2);
if (exit_state != EXIT_ZOMBIE) BUG_ON(exit_state != EXIT_ZOMBIE);
BUG();
release_task(leader); release_task(leader);
} }
...@@ -772,10 +770,8 @@ static inline int de_thread(struct task_struct *tsk) ...@@ -772,10 +770,8 @@ static inline int de_thread(struct task_struct *tsk)
kmem_cache_free(sighand_cachep, oldsighand); kmem_cache_free(sighand_cachep, oldsighand);
} }
if (!thread_group_empty(current)) BUG_ON(!thread_group_empty(current));
BUG(); BUG_ON(!thread_group_leader(current));
if (!thread_group_leader(current))
BUG();
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment