Re: [PATCH 9/9] mm/gup: unshare-check every page of a pte batch

From: David Hildenbrand (Arm)

Date: Thu Nov 26 2026 - 08:51:10 EST


On 11/23/26 20:56, Rik van Riel wrote:
> A slow GUP write pin over a PTE batch can hand back pages that a later
> write fault replaces under the pin holder: the process writes to
> the copy, the holder keeps the old page:
>
> pin holder process (mm owner)
> pin all 16 for write
> batch passes unchecked
> write to a page
> fault copies it elsewhere
> read pinned page -> stale
>
> With GUP-fast, FOLL_WRITE | FOLL_PIN can never reach
> gup_pages_not_requiring_unshare, but slow GUP can reach it
> with a read-only head PTE.

I assume you mean FOLL_FORCE?

I don't quite understand the problem you are trying to solve reading this.

So can you walk me through the exact sequence of events + flags that are being
passed?

--
Cheers,

David