]> git.openfabrics.org - ~shefty/rdma-dev.git/blobdiff - kernel/fork.c
uprobes: Use percpu_rw_semaphore to fix register/unregister vs dup_mmap() race
[~shefty/rdma-dev.git] / kernel / fork.c
index 8b20ab7d3aa2951eff91a4e09e0af23a90992747..c497e57aa654a0e2af2eb74ad43cc8d19f42691c 100644 (file)
@@ -352,6 +352,7 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)
        unsigned long charge;
        struct mempolicy *pol;
 
+       uprobe_start_dup_mmap();
        down_write(&oldmm->mmap_sem);
        flush_cache_dup_mm(oldmm);
        uprobe_dup_mmap(oldmm, mm);
@@ -469,6 +470,7 @@ out:
        up_write(&mm->mmap_sem);
        flush_tlb_mm(oldmm);
        up_write(&oldmm->mmap_sem);
+       uprobe_end_dup_mmap();
        return retval;
 fail_nomem_anon_vma_fork:
        mpol_put(pol);