X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=fs%2Fexec.c;h=70fa36554c1423ae8c4b1c961801aeb1b9ed8d36;hb=b196fc69f7be7b4454781add9c2d5173f44d509b;hp=1ba85c7fc6af7e4290ac494563f3fc6c8d8587bd;hpb=38cb162b7585d837083b8365da1eb32687c5164c;p=powerpc.git diff --git a/fs/exec.c b/fs/exec.c index 1ba85c7fc6..70fa36554c 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -50,6 +50,7 @@ #include #include #include +#include #include #include @@ -581,6 +582,13 @@ static int de_thread(struct task_struct *tsk) struct task_struct *leader = NULL; int count; + /* + * Tell all the sighand listeners that this sighand has + * been detached. The signalfd_detach() function grabs the + * sighand lock, if signal listeners are present on the sighand. + */ + signalfd_detach(tsk); + /* * If we don't share sighandlers, then we aren't sharing anything * and we can just re-use it all. @@ -702,7 +710,7 @@ static int de_thread(struct task_struct *tsk) */ detach_pid(tsk, PIDTYPE_PID); tsk->pid = leader->pid; - attach_pid(tsk, PIDTYPE_PID, tsk->pid); + attach_pid(tsk, PIDTYPE_PID, find_pid(tsk->pid)); transfer_pid(leader, tsk, PIDTYPE_PGID); transfer_pid(leader, tsk, PIDTYPE_SID); list_replace_rcu(&leader->tasks, &tsk->tasks); @@ -757,8 +765,7 @@ no_thread_group: spin_unlock(&oldsighand->siglock); write_unlock_irq(&tasklist_lock); - if (atomic_dec_and_test(&oldsighand->count)) - kmem_cache_free(sighand_cachep, oldsighand); + __cleanup_sighand(oldsighand); } BUG_ON(!thread_group_leader(tsk)); @@ -1488,6 +1495,8 @@ int do_coredump(long signr, int exit_code, struct pt_regs * regs) int flag = 0; int ispipe = 0; + audit_core_dumps(signr); + binfmt = current->binfmt; if (!binfmt || !binfmt->core_dump) goto fail;