Skip to content
Commit d6c355c7 authored by Benjamin LaHaise's avatar Benjamin LaHaise
Browse files

aio: fix race in ring buffer page lookup introduced by page migration support

Prior to the introduction of page migration support in "fs/aio: Add support
to aio ring pages migration" / 36bc08cc

,
mapping of the ring buffer pages was done via get_user_pages() while
retaining mmap_sem held for write.  This avoided possible races with userland
racing an munmap() or mremap().  The page migration patch, however, switched
to using mm_populate() to prime the page mapping.  mm_populate() cannot be
called with mmap_sem held.

Instead of dropping the mmap_sem, revert to the old behaviour and simply
drop the use of mm_populate() since get_user_pages() will cause the pages to
get mapped anyways.  Thanks to Al Viro for spotting this issue.

Signed-off-by: default avatarBenjamin LaHaise <bcrl@kvack.org>
parent 77d30b14
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment