Re: [PATCH v4 07/14] mm: handle VM_UFFD_RWP in khugepaged, rmap, and GUP

From: Kiryl Shutsemau

Date: Mon May 25 2026 - 11:19:39 EST


On Mon, May 25, 2026 at 01:19:22PM +0000, sashiko-bot@xxxxxxxxxx wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [High] GUP enters an infinite loop when using FOLL_FORCE on an
> inaccessible (PROT_NONE) VMA that has VM_UFFD_RWP enabled.

Confirmed. RWP resolution restores vm_page_prot, which is PAGE_NONE on
a PROT_NONE VMA -- the page never becomes accessible and FOLL_FORCE
loops. Will fix in v5 by rejecting the registration up front in
vma_can_userfault():

+ if ((vm_flags & VM_UFFD_RWP) && !vma_is_accessible(vma))
+ return false;

> --
> Sashiko AI review · https://sashiko.dev/#/patchset/20260525113737.1942478-1-kas@xxxxxxxxxx?part=7

--
Kiryl Shutsemau / Kirill A. Shutemov