diff --git a/fs/aio.c b/fs/aio.c index 6e26755..6ef73fd 100644 --- a/fs/aio.c +++ b/fs/aio.c @@ -312,8 +312,10 @@ static int aio_setup_ring(struct kioctx *ctx) mm_populate(ctx->mmap_base, populate); pr_debug("mmap address: 0x%08lx\n", ctx->mmap_base); + down_read(&mm->mmap_sem); ctx->nr_pages = get_user_pages(current, mm, ctx->mmap_base, nr_pages, 1, 0, ctx->ring_pages, NULL); + up_read(&mm->mmap_sem); for (i = 0; i < ctx->nr_pages; i++) put_page(ctx->ring_pages[i]);