Re: [PATCH RFC v4 04/12] mm/gup: let check_vma_flags() ignore selected VMA flags

From: Rik van Riel

Date: Tue Jul 28 2026 - 10:41:03 EST


On Mon, 2026-07-27 at 19:40 -0700, John Hubbard wrote:
>
> Perhaps it is best to replace the mask with a single-purpose internal
> GUP flag, such as FOLL_PFNMAP_COW, and apply it only to the
> special-mapping gate:
>
> if (vm_flags & (VM_IO | VM_PFNMAP) &&
>     (!(gup_flags & FOLL_PFNMAP_COW) ||
>      !(vm_flags & VM_PFNMAP)))
> return -EFAULT;
>
> This permits the later caller to examine a VM_PFNMAP mapping while
> keeping VM_IO-only mappings and every other VMA check unchanged.

Nice idea. I will implement that for v5!


--
All Rights Reversed.