diff options
Diffstat (limited to 'kernel/fork.c')
-rw-r--r-- | kernel/fork.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/kernel/fork.c b/kernel/fork.c index b9372a0bff18..ca9a3845ef3e 100644 --- a/kernel/fork.c +++ b/kernel/fork.c | |||
@@ -67,6 +67,7 @@ | |||
67 | #include <linux/oom.h> | 67 | #include <linux/oom.h> |
68 | #include <linux/khugepaged.h> | 68 | #include <linux/khugepaged.h> |
69 | #include <linux/signalfd.h> | 69 | #include <linux/signalfd.h> |
70 | #include <linux/uprobes.h> | ||
70 | 71 | ||
71 | #include <asm/pgtable.h> | 72 | #include <asm/pgtable.h> |
72 | #include <asm/pgalloc.h> | 73 | #include <asm/pgalloc.h> |
@@ -421,6 +422,9 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm) | |||
421 | 422 | ||
422 | if (retval) | 423 | if (retval) |
423 | goto out; | 424 | goto out; |
425 | |||
426 | if (file && uprobe_mmap(tmp)) | ||
427 | goto out; | ||
424 | } | 428 | } |
425 | /* a new mm has just been created */ | 429 | /* a new mm has just been created */ |
426 | arch_dup_mmap(oldmm, mm); | 430 | arch_dup_mmap(oldmm, mm); |
@@ -569,6 +573,7 @@ void mmput(struct mm_struct *mm) | |||
569 | might_sleep(); | 573 | might_sleep(); |
570 | 574 | ||
571 | if (atomic_dec_and_test(&mm->mm_users)) { | 575 | if (atomic_dec_and_test(&mm->mm_users)) { |
576 | uprobe_clear_state(mm); | ||
572 | exit_aio(mm); | 577 | exit_aio(mm); |
573 | ksm_exit(mm); | 578 | ksm_exit(mm); |
574 | khugepaged_exit(mm); /* must run before exit_mmap */ | 579 | khugepaged_exit(mm); /* must run before exit_mmap */ |
@@ -747,6 +752,8 @@ void mm_release(struct task_struct *tsk, struct mm_struct *mm) | |||
747 | exit_pi_state_list(tsk); | 752 | exit_pi_state_list(tsk); |
748 | #endif | 753 | #endif |
749 | 754 | ||
755 | uprobe_free_utask(tsk); | ||
756 | |||
750 | /* Get rid of any cached register state */ | 757 | /* Get rid of any cached register state */ |
751 | deactivate_mm(tsk, mm); | 758 | deactivate_mm(tsk, mm); |
752 | 759 | ||
@@ -801,6 +808,7 @@ struct mm_struct *dup_mm(struct task_struct *tsk) | |||
801 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | 808 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE |
802 | mm->pmd_huge_pte = NULL; | 809 | mm->pmd_huge_pte = NULL; |
803 | #endif | 810 | #endif |
811 | uprobe_reset_state(mm); | ||
804 | 812 | ||
805 | if (!mm_init(mm, tsk)) | 813 | if (!mm_init(mm, tsk)) |
806 | goto fail_nomem; | 814 | goto fail_nomem; |
@@ -1342,6 +1350,7 @@ static struct task_struct *copy_process(unsigned long clone_flags, | |||
1342 | INIT_LIST_HEAD(&p->pi_state_list); | 1350 | INIT_LIST_HEAD(&p->pi_state_list); |
1343 | p->pi_state_cache = NULL; | 1351 | p->pi_state_cache = NULL; |
1344 | #endif | 1352 | #endif |
1353 | uprobe_copy_process(p); | ||
1345 | /* | 1354 | /* |
1346 | * sigaltstack should be cleared when sharing the same VM | 1355 | * sigaltstack should be cleared when sharing the same VM |
1347 | */ | 1356 | */ |