cpu: report a named skip for the pe_map blast longjmp cases when CFG is active #1607
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1614"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from R0Y00/Xbox2Windows. Originally posted by MasterDomino on 2026-11-24T15:03:03Z.
Refs #1293 (option 2, as agreed there; the issue stays open for actual mapped
longjmpsupport under CFG)When Control Flow Guard is active in the process that runs a
pe_map-mapped fixture, blast's out-of-inputlongjmpfails fast withFAST_FAIL_INVALID_LONGJUMP_TARGET. The root cause is on #1293: ntdll accepts a long-jump target only inside an image the Windows loader registered, or under a process-wide protected policy, andpe_mapmapsblast_sourceprivately. This change makes the three affected checks report a named capability skip for exactly that mapped case. The host's CFG policy is left in force.Change
tests/cpu/archive_check.py:X2W_MAPPED_LONGJMP_CASE=1only when the case's expected trace reaches blast's longjmp. That is theinput 0pull, the only path to it.--mapped), before mapping anything, reads its own effective policy withGetProcessMitigationPolicy(ProcessControlFlowGuardPolicy). IfEnableControlFlowGuardis set, it writesskip: CFG is active in the pe_map runner; blast's out-of-input longjmp would fail fast (#1293)to stderr and exits 77.cannot read the CFG policy of the pe_map runner: error Nand exits 1, so the test fails explicitly.archive_texture_check.pyandarchive_texture_gpu_check.py: they use the same helper (run_mapped_case) for theirpe_maprunner.CMakeLists.txt:SKIP_RETURN_CODE 77oncpu_native_archive_blast,cpu_archive_texture_publicationandcpu_archive_texture_gpu_warp.cpu_archive_texture_gpu_hardwarealready had it, for a missing adapter.cpu_native_archive_reader(no blast mapped) are unchanged.Verification
main+ this change at7d4b477d(on81df4051). Windows 11 26H2, build 26300.9974,ntdll10.0.26100.9974, system CFG settingNOTSET, Python 3.13.1,devpreset.1. Normal run (CFG not active for the runner on this host):
5/5 pass, no skip.
2. The mapped child itself, started with
PROC_THREAD_ATTRIBUTE_MITIGATION_POLICY(CFGALWAYS_ON/ALWAYS_OFF) on the base interpreter, as in the launcher on #1293:… input 4 / input 0 / output 1 / free / completed 1: error, cleanup and exit still checked0xC00004093. End to end (scratch harness, not committed): all three checks run in process, with only their
pe_mapchildren started under CFGALWAYS_ON. A policy set on the parent is not inherited by its children, so the parent alone cannot show this.archive_check.py: only the 14-byte mapped case is skipped; exit 77.archive_texture_check.py: only mappedtruncatedis skipped; mappedbothpasses under CFG; exit 77.archive_texture_gpu_check.py(WARP): only mappedtruncatedandfirstare skipped; mappedboth,stale,fail(exit 4) andleakpass under CFG; exit 77.Each prints
skip: CFG is active in the pe_map runner, so its blast longjmp cases did not run (#1293): <cases>.4. Policy read failure:
cfg_active()with akernel32stand-in whoseGetProcessMitigationPolicyreturns 0 raisescannot read the CFG policy of the pe_map runner: error 0.I have no CFG-enforced host where the policy reaches the test children through CTest. @legacy-code-archaeologist offered a Windows 11 26100 rerun on #1293.
AI-assisted.
🤖 Generated with Claude Code
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T15:13:01Z.
Review: COMMENTED
Reviewed
7d4b477d463b444f4f0dd1188e8f3ebf0b6b712e:tests/cpu/archive_check.py,tests/cpu/archive_texture_check.py, andtests/cpu/archive_texture_gpu_check.pycleanly isolate thepe_mapblast out-of-inputlongjmpcases ("input 0"in the expected trace, marked viaX2W_MAPPED_LONGJMP_CASE=1). Whencfg_active()(GetProcessMitigationPolicy(..., ProcessControlFlowGuardPolicy, ...)) reports CFG active in the mapped child before mapping, it emits the named skip message and exits77;run_mapped_caseonly treats it as skipped when bothreaches_longjmpand theCFG_SKIPmarker + exit77match, whileCMakeLists.txtwiresSKIP_RETURN_CODE 77on the affectedcpu_*tests.python3 tests/docs_links_check.py(16 Markdown files, 348 links),python3 tests/bidi_controls_check.py(1262 files), andpython3 -m py_compile tests/cpu/archive_check.py tests/cpu/archive_texture_check.py tests/cpu/archive_texture_gpu_check.pypassed.--preset dev):cmake --build --preset dev --target archive_all_lifted archive_codec archive_codec_gpu archive_codec_lifted archive_directory_gpu archive_directory_lifted archive_reader_lifted archive_texture_gpu_lifted archive_texture_lifted blast_lifted blast_source pe_map+ctest --preset dev -R '^(cpu_archive_directory_gpu_warp|cpu_archive_texture_gpu_warp|cpu_archive_texture_publication|cpu_native_archive_blast|cpu_native_archive_reader)$' --parallel 4 --no-tests=error --output-on-failure-> 5/5 passed (10.53s)./O2(--preset release): same targets andctest --preset release-> 5/5 passed (10.10s).AI-assisted; commands listed were executed locally.