Anonymous memory read SM_PRIVATE is not provably unchanging: the region walk
takes one from the object's reference count while paging on it is in
progress (osfmk/vm/vm_map.c:16002-16005), and a wire holds no reference
(vm_object_iopl_request, osfmk/vm/vm_pageout.c:8331; upl_destroy, 5683-5685),
so a driver's wire for writing taken while the memory was writable, our own
kext's for a writable block among them, still writes its pages after the
maximum protection lost write, under a count of one. A once-made copy would
then be wrong for the block's life. Such memory is read-only again, why not a
file, and its blocks are copied whole at each commit as before.
What stays unchanging is SM_COW at shadow depth 0, with no write in the
maximum protection, which is sound against wires too (xnu main as read on
2026-11-20):
- such a pending copy is vm_object_copy_quickly's of an object whose copy
strategy is still symmetric (osfmk/vm/vm_object.c:3586-3605), and a wire
makes its object's strategy a delayed copy (vm_pageout.c:8404-8423), so the
object was not wired before the copy;
- a wire through either side after it resolves that side's pending copy
first, shadowing it (vm_map_create_upl, vm_pageout.c:7140-7188), as a write
fault does (vm_map_lookup_and_lock_object, vm_map.c:14866-14897) and a share
does (vm_map_remap_extract, vm_map.c:18314-18396), so the other side's writes
and wires land in a copy of its own.
What the host sees: blocks of anonymous memory SM_PRIVATE no longer carry
RGFX_SURFACE_PAGES_UNCHANGING; those with a copy pending carry it with
RGFX_SURFACE_PAGES_COPY_ON_WRITE. The bundle's classification line drops the
private clause. The tests hold both.