Re: [PATCH 19/32] mm/gup: check for fatal signals in memfd_pin_folios()
From: Gregory Price (Meta)
Date: Wed Dec 02 2026 - 00:52:29 EST
On 2026-11-29 11:06 +0100, David Hildenbrand (Arm) wrote:
> memfd_pin_folios() retries on -EAGAIN until it can isolate all folios
> that are not longterm pinnable, which can take an unbounded time.
>
> Consequently, as it never checks for fatal signals, UDMABUF_CREATE, for
> example, cannot be killed while it holds the inode lock of the memfd,
> blocking a fallocate() of the file.
>
> Let's fix it by checking for fatal signals before each attempt, like
> __get_user_pages() does for __gup_longterm_locked().
>
> This has medium urgency, as permanently failing isolation, as recently
> seen with hugetlb, makes the task hang forever.
>
> Fixes: 89c1905d9c14 ("mm/gup: introduce memfd_pin_folios() for pinning memfd folios")
> Cc: stable@xxxxxxxxxxxxxxx
> Reported-by: Chris Mason <mason@xxxxxxxxxx>
> Signed-off-by: David Hildenbrand (Arm) <david@xxxxxxxxxx>
Tested-by: Gregory Price (Meta) <gourry@xxxxxxxxxx>
Reviewed-by: Gregory Price (Meta) <gourry@xxxxxxxxxx>
--
~Gregory