mm/pagemap: add mmap_assert_locked() annotations to find_vma*()
[sfrench/cifs-2.6.git] / fs / exec.c
index 41a888d4edde056a4d991f01907eb6728a532390..fd292e9da4f97673a07264a2e1f74eaf070dc16b 100644 (file)
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -217,8 +217,10 @@ static struct page *get_arg_page(struct linux_binprm *bprm, unsigned long pos,
         * 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;