diff --git a/mm/mlock.c b/mm/mlock.c index c15b5ef12d0b..188aa7458c99 100644 --- a/mm/mlock.c +++ b/mm/mlock.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -470,8 +471,15 @@ void munlock_vma_pages_range(struct vm_area_struct *vma, * has sneaked into the range, we won't oops here: great). */ page = follow_page(vma, start, FOLL_GET | FOLL_DUMP); - if (page && !IS_ERR(page)) { + /* + * munlock_vma_pages_range uses follow_page(FOLL_GET) + * so it need to use put_user_page but the munlock + * path is quite complicated to deal with each put + * sites correctly so just unattribute them to avoid + * false positive at this moment. + */ + reset_page_pinner(page, compound_order(page)); if (PageTransTail(page)) { VM_BUG_ON_PAGE(PageMlocked(page), page); put_page(page); /* follow_page_mask() */