Re: [PATCH] mm/vma: undo userfaultfd unmap preparation when unmapping fails
From: Tal Zussman
Date: Sun Nov 01 2026 - 08:55:16 EST
On Sun, 01 Nov 2026 10:24:02 +0200, Mike Rapoport (Microsoft) <rppt@xxxxxxxxxx> wrote:
> vms_gather_munmap_vmas() collects VMAs to unmap and calls
> userfaultfd_unmap_prep() for each of these VMAs. This takes a reference
> to the userfaultfd context, raises ctx->mmap_changing and queues an
> UFFD_EVENT_UNMAP on the caller's list.
>
> If gathering fails half way, e.g. because one of the VMAs is sealed, or
> the operation fails after the VMAs were gathered, the original mappings
> stay intact but the queued events remain on the list.
>
> [...]
Reviewed-by: Tal Zussman <tz2294@xxxxxxxxxxxx>
Tested-by: Tal Zussman <tz2294@xxxxxxxxxxxx>
--
Tal Zussman <tz2294@xxxxxxxxxxxx>