Repository navigation
Conversation
view_protect mapped pages read-write in a window reserved PAGE_NOACCESS. The GDK documents a mapping's protection as its reservation's: the XMemMapPhysicalPages reference maps one set of pages into a PAGE_READWRITE and a PAGE_READONLY reservation. The two retail windows reserved this way pass 0x801 (PAGE_NOACCESS | PAGE_GRAPHICS_NOACCESS), which denies the GPU as well. xmem_test covers the documented example in its 64 KiB-page form and a 0x801 window. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Independent Windows test of Setup: Windows 11 x64, MSVC 19.44.35220 (
AI-assisted review/test. |
|
Tested
AI-assisted (Claude Code). |
|
Tested c54e232 on Windows 11, AMD Radeon RX 9070 XT (RDNA4), driver 32.0.32029.2010: pass
AI-assisted (Claude Code). |
|
Tested head c54e232 against main dde82f2 (merges clean, tree 57a22b702). C++-only diff (xmem view_protect + test) — not runnable on this Linux host (no wine/cmake); CI is the execution gate. Review: main still has the PAGE_NOACCESS→PAGE_READWRITE escalation from #6919, so no supersession; the claim is grounded in the GDK mapping-protection rule and the 0x801 attrs recorded in docs/xmem_exe_calls.md, and test_mapping_protection exercises both the documented RW+RO example and the 0x801 case with before/after results. Note: #7492 is open editing the same view_protect (#7499 closed unmerged since check) — whichever lands first, the other rebakes. Flag: NO CI checks reported on the branch — please get CI running before merge. AI-assisted: yes. Tested on Linux (RTX 5080 host, CPU-only run). |
…ts window's PAGE_NOACCESS Squashed from ProjectLeonida#7693 by lisboon, head c54e232 (security scan PASS). Conflict: view_protect, which ProjectLeonida#7550 changed to drop PAGE_WRITECOMBINE/PAGE_NOCACHE (and kept PAGE_NOACCESS -> PAGE_READWRITE). Kept both intents: the window's protection is returned as is (a 0x801 window maps PAGE_NOACCESS, ProjectLeonida#7693) minus the cache modifiers (ProjectLeonida#7550). xmem_test under Wine 11.22: 600 checks OK, including both PRs' cases.
Claimed in the coordination issue as: #7496 (comment)
Depends on: none. Touches
view_protect, as #7492 and #7499 do (cache modifiers); whichever lands first, the other rebases on a one-line function.What and why
Since #6919,
XMemMapPhysicalPagesandXMemMapPhysicalPagesScattermap a page read-write when its window was reservedPAGE_NOACCESS.XMemMapPhysicalPagestakes no protection: the GDK documents a mapping's protection as its reservation's. TheXMemMapPhysicalPagesreference maps one set of pages into aPAGE_READWRITEand aPAGE_READONLYreservation, and the memory guide says pages "can be mapped multiple times with different page protections".The two retail windows reserved
PAGE_NOACCESSpass0x801,PAGE_NOACCESS | PAGE_GRAPHICS_NOACCESS(docs/xmem_exe_calls.md, attributes0x3), so on the console neither the CPU nor the GPU reaches those pages through them. Slot 133 (#7218) places GPU resources in the0x20406000windows, which are CPU read-write, not in these.view_protectnow returns the window's protection.Tests
Synthetic only, no game files. Windows 11 26200, RTX 4060 (NVIDIA 621.24), VS 2026 MSVC, Vulkan SDK 1.4.363.0.
xmem_testcasetest_mapping_protection: the documented example in its 64 KiB-page form (one set of pages in aPAGE_READWRITEand aPAGE_READONLYwindow; written through the first, compared through the second; the read-only view isPAGE_READONLY) and a0x801window, whose mapped page must bePAGE_NOACCESS.FAIL a page mapped in a 0x801 window is PAGE_NOACCESS(1 of 181). With it:xmem_test: OK (181 checks).ctest: serial run on203a348cf+ this change, 247 passed; the only failures are the three already failing onmainhere (d3d12_vulkan_device,d3d12_indirect_dispatch_count,d3d12_indirect_rt: TEST-1698 / d3d12: an ARRAY_OF_POINTERS entry below the arena is not an overflow (d3d12_indirect_rt on NVIDIA) #6010).Not run against the retail executable. Someone with a boot stack past the physical-page stops: a run with this change shows whether anything in the runtime reads those
0x801pages through the title's VA (it would now fault there instead of reading).AI-assisted (Claude Code).
🤖 Generated with Claude Code