* We are doing an exec().  'current' is the process
         * doing the exec and bprm->mm is the new process's mm.
         */
+       mmap_read_lock(bprm->mm);
        ret = get_user_pages_remote(bprm->mm, pos, 1, gup_flags,
                        &page, NULL, NULL);
+       mmap_read_unlock(bprm->mm);
        if (ret <= 0)
                return NULL;
 
 
 {
        struct rb_node **__rb_link, *__rb_parent, *rb_prev;
 
+       mmap_assert_locked(mm);
        __rb_link = &mm->mm_rb.rb_node;
        rb_prev = __rb_parent = NULL;
 
        struct rb_node *rb_node;
        struct vm_area_struct *vma;
 
+       mmap_assert_locked(mm);
        /* Check the cache first. */
        vma = vmacache_find(mm, addr);
        if (likely(vma))
 
                      struct tomoyo_page_dump *dump)
 {
        struct page *page;
+#ifdef CONFIG_MMU
+       int ret;
+#endif
 
        /* dump->data is released by tomoyo_find_next_domain(). */
        if (!dump->data) {
        /*
         * This is called at execve() time in order to dig around
         * in the argv/environment of the new proceess
-        * (represented by bprm).  'current' is the process doing
-        * the execve().
+        * (represented by bprm).
         */
-       if (get_user_pages_remote(bprm->mm, pos, 1,
-                               FOLL_FORCE, &page, NULL, NULL) <= 0)
+       mmap_read_lock(bprm->mm);
+       ret = get_user_pages_remote(bprm->mm, pos, 1,
+                                   FOLL_FORCE, &page, NULL, NULL);
+       mmap_read_unlock(bprm->mm);
+       if (ret <= 0)
                return false;
 #else
        page = bprm->page[pos / PAGE_SIZE];