Re: [PATCH RFC 0/5] mm: GUP dirty + ->release_folio() fixes

From: Christoph Hellwig

Date: Wed Nov 25 2026 - 05:05:53 EST


On Wed, Nov 25, 2026 at 10:50:42AM +0100, David Hildenbrand (Arm) wrote:
> When I looked into this issue, there were some problematic things.
>
> We have some odd drivers that use FOLL_GET|FOLL_WRITE, but I am not too
> concerned about them.
>
> But are ways where unprivileged users can mess with FOLL_GET|FOLL_WRITE
> references to trigger this.
>
> I think the two that stand out are:
>
> 1) /proc/self/mem access using mem_rw() -> access_remote_vm()
>
> User can write to a writable-mapped page-cache PTE. Then we can race with
> removal of folio metadta, to then set the folio dirty afterwards.
>
> I remember a good reason to not convert these paths in the past (we are not
> performing DMA).

I don't think that is a good reason. For file system backed VMAs we
really need the pin to be able to do someting sane, DMA or not.

> 1) We fix all such cases now where unprivileged users can trigger this,
> converting to FOLL_PIN.

We need to, if not for this series then for all the other outstanding
issues with GUP writes.