[PATCH v2 25/47] mm/userfaultfd: wake waiters when registration modes are removed

sashiko-bot at kernel.org sashiko-bot at kernel.org
Thu Oct 29 20:41:30 PDT 2026


> UFFDIO_REGISTER can replace MISSING or MINOR tracking without waking
> faults that are already queued. For example, switching an anonymous
> range from MISSING to WP leaves a missing-fault waiter asleep until
> userspace explicitly wakes it.
> 
> When a registration change removes a UFFD mode, wake waiters in the
> affected interval after updating the VMA. The VMA is write-locked at
> this point, so no new faults can queue under the old modes and woken
> threads cannot retry until mmap_write_unlock(). Waiters for retained
> modes in the same interval may also wake and refault.
> 
> The hang reproduces for MISSING-to-WP and MINOR-to-MISSING transitions,
> with both read and unread fault events.
> 
> Fixes: 63b2d4174c4a ("userfaultfd: wp: add the writeprotect API to userfaultfd ioctl")
> Cc: stable at vger.kernel.org
> Reviewed-by: Gregory Price (Meta) <gourry at gourry.net>
> Tested-by: Gregory Price (Meta) <gourry at gourry.net>
> Signed-off-by: Gregory Price (Meta) <gourry at gourry.net>
> Reviewed-by: Mike Rapoport (Microsoft) <rppt at kernel.org>
> Reviewed-by: Lorenzo Stoakes (ARM) <ljs at kernel.org>
> Signed-off-by: David Hildenbrand (Arm) <david at kernel.org>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261029-fixes_core-v2-0-a64ce7f83abb@kernel.org?part=25




More information about the kexec mailing list