[PATCH v3 0/4] mm: userfaultfd: assorted fixes and cleanups
From: Tal Zussman
Date: Thu Jun 19 2025 - 21:25:05 EST
Two fixes and two cleanups for userfaultfd.
Note that the third patch yields a small change in the ABI, but we seem
to have concluded that that's acceptable in this case.
---
Changes in v3:
- Propagate tags. (David, Jason)
- Move the uffd unregistration fixes patch before the
VM_WARN_ON_ONCE() conversion patch, as per David.
- Update comments and commit message of 2/4, as per David.
- Update the commit message in 3/4 with more details about various
conversions, as per David.
- Convert two additional WARN_ON()s in 3/4, as per David.
- Link to v2: https://lore.kernel.org/r/20250607-uffd-fixes-v2-0-339dafe9a2fe@xxxxxxxxxxxx
Changes in v2:
- Remove Pavel Emelyanov <xemul@xxxxxxxxxxxxx> from To: due to bouncing
email.
- Propagate tags. (David, Peter)
- Add a patch converting userfaultfd BUG_ON()s to VM_WARN_ON_ONCE().
- Move the "different uffd" check in Patch 3 (prev. Patch 2) before the
vma_can_userfault() check due to the wp_async bug, as per James.
- Change the added BUG_ON() in Patch 3 to a VM_WARN_ON_ONCE, as per
James and David.
- Reorder the assertions in Patch 3 to simplify them and avoid the
wp_async bug, as per James.
- Update the Patch 3 commit message to include more details, as per
Peter.
- Link to v1: https://lore.kernel.org/r/20250603-uffd-fixes-v1-0-9c638c73f047@xxxxxxxxxxxx
---
Tal Zussman (4):
userfaultfd: correctly prevent registering VM_DROPPABLE regions
userfaultfd: prevent unregistering VMAs through a different userfaultfd
userfaultfd: remove (VM_)BUG_ON()s
userfaultfd: remove UFFD_CLOEXEC, UFFD_NONBLOCK, and UFFD_FLAGS_SET
fs/userfaultfd.c | 78 ++++++++++++++++++++++---------------------
include/linux/userfaultfd_k.h | 6 +---
mm/userfaultfd.c | 68 ++++++++++++++++++-------------------
3 files changed, 74 insertions(+), 78 deletions(-)
---
base-commit: 546b1c9e93c2bb8cf5ed24e0be1c86bb089b3253
change-id: 20250531-uffd-fixes-142331b15e63
Best regards,
--
Tal Zussman <tz2294@xxxxxxxxxxxx>