[DragonFlyBSD - Bug #3431] (New) pc64: writing an mlock()ed MAP_PRIVATE COW mapping faults
sigttou
bugtracker-admin at leaf.dragonflybsd.org
Sat Oct 3 08:27:51 PDT 2026
Issue #3431 has been reported by sigttou.
----------------------------------------
Bug #3431: pc64: writing an mlock()ed MAP_PRIVATE COW mapping faults
http://bugs.dragonflybsd.org/issues/3431
* Author: sigttou
* Status: New
* Priority: Normal
* Category: Kernel
* Target version: 6.6
* Start date: 2026-10-03
----------------------------------------
A write to a writable MAP_PRIVATE file mapping that was mlock()ed faults with
SIGSEGV before the write completes. The same mapping without mlock() works, and
no mprotect() step is needed.
After mlock() the mapping is both user-wired and copy-on-write. On the write
fault, vm_map_lookup() refuses to let a user-wired COW entry be written, and the
normal fault path does not force the copy-on-write, so the write never completes.
mlock() has already created the shadow object, so the write is an ordinary COW
into the process's own memory.
Fix: remove the obsolete check so the normal copy-on-write path runs.
This is a companion to the pc64 pmap fix #3430. With only the vm_map change, the write
succeeds but munlock() then panics with the pmap wire-count underflow.
---Files--------------------------------
0002-vm-map-allow-wired-cow-write.patch (1.4 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