diff options
Diffstat (limited to 'fs/exec.c')
-rw-r--r-- | fs/exec.c | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -50,6 +50,7 @@ | |||
50 | #include <linux/tsacct_kern.h> | 50 | #include <linux/tsacct_kern.h> |
51 | #include <linux/cn_proc.h> | 51 | #include <linux/cn_proc.h> |
52 | #include <linux/audit.h> | 52 | #include <linux/audit.h> |
53 | #include <linux/signalfd.h> | ||
53 | 54 | ||
54 | #include <asm/uaccess.h> | 55 | #include <asm/uaccess.h> |
55 | #include <asm/mmu_context.h> | 56 | #include <asm/mmu_context.h> |
@@ -582,6 +583,13 @@ static int de_thread(struct task_struct *tsk) | |||
582 | int count; | 583 | int count; |
583 | 584 | ||
584 | /* | 585 | /* |
586 | * Tell all the sighand listeners that this sighand has | ||
587 | * been detached. The signalfd_detach() function grabs the | ||
588 | * sighand lock, if signal listeners are present on the sighand. | ||
589 | */ | ||
590 | signalfd_detach(tsk); | ||
591 | |||
592 | /* | ||
585 | * If we don't share sighandlers, then we aren't sharing anything | 593 | * If we don't share sighandlers, then we aren't sharing anything |
586 | * and we can just re-use it all. | 594 | * and we can just re-use it all. |
587 | */ | 595 | */ |
@@ -757,8 +765,7 @@ no_thread_group: | |||
757 | spin_unlock(&oldsighand->siglock); | 765 | spin_unlock(&oldsighand->siglock); |
758 | write_unlock_irq(&tasklist_lock); | 766 | write_unlock_irq(&tasklist_lock); |
759 | 767 | ||
760 | if (atomic_dec_and_test(&oldsighand->count)) | 768 | __cleanup_sighand(oldsighand); |
761 | kmem_cache_free(sighand_cachep, oldsighand); | ||
762 | } | 769 | } |
763 | 770 | ||
764 | BUG_ON(!thread_group_leader(tsk)); | 771 | BUG_ON(!thread_group_leader(tsk)); |