[DragonFlyBSD - Bug #3442] (New) vm: make normal MAP_FIXED replacement atomic

sigttou bugtracker-admin at leaf.dragonflybsd.org
Sun Oct 4 21:24:24 PDT 2026


Issue #3442 has been reported by sigttou.

----------------------------------------
Bug #3442: vm: make normal MAP_FIXED replacement atomic
http://bugs.dragonflybsd.org/issues/3442

* Author: sigttou
* Status: New
* Priority: Normal
* Category: Kernel
* Target version: 6.6
* Start date: 2026-10-05
----------------------------------------
vm_mmap() removes an existing mapping before looking up the new object
and inserting its mapping.  If the thread blocks in between, its LWKT
tokens are released and another mmap() can claim the vacated range.
The fixed mapping then fails with KERN_NO_SPACE.

Add vm_map_replace() for normal MAP_FIXED mappings.  Wait for entries
in transition before deleting any part of the range, then delete and
insert under the same map lock.  Acquire the new object's shared token
after deletion, since deleting an old mapping of the same object may
require its token exclusively.  UKSMAP, virtual page table and internal
stack mappings keep separate removal and insertion.

---Files--------------------------------
0001-vm-make-normal-MAP_FIXED-replacement-atomic.patch (5 KB)


-- 
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://bugs.dragonflybsd.org/my/account


More information about the Bugs mailing list